php - Can't seem to make mysqli_insert_id work -


i have been trying make work few hours , can't seem make of it. code using below. working on phpbb page, explains template , sql query setup.

$sql_query = 'insert ' . rosters . ' ' . $db->sql_build_array('insert', $sql_rost); $result_rost = $db->sql_query($sql_query);  $roster_last = $mysqli->insert_id;   $template->assign_block_vars('some_block', array(     'roster'    => $roster_last,     'test' =>'test' )); $db->sql_freeresult($result_rost); 

the insert query works because see new entry in database, , on template used test make sure block showing up, is.

also, didn't use

mysqli_insert_id($link)  

because connected database snippet of code don't want replicate database connection. without $link error mysqli_insert_id expecting parameter.

i dont think can use mysql make query, , use mysqli id. try this:

$db->insert_id; 

edit: noticed said working phpbb. phpbb wiki suggests following:

$db->sql_nextid(); 

source: https://wiki.phpbb.com/database_abstraction_layer


Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -