I'm attempting to pull a auto incremented id from a previous query. I receive exception: 1305 FUNCTION THE_NAME_OF_MY_DATABASE.mysqli_insert_id does not exist.
- This can't be a syntax error correct?
Where can I alter mysql to have this function or what needs to be rephrased? I've googled this and found mixed responses.
$action = isset( $_POST['action'] ) ? $_POST['action'] : ""; if($action == "create"){ //write the query for character creation $query = "(all of my stuff that I'm putting into another database that works)"; $query1 = "INSERT INTO playerskill (skillid, charid) VALUES ('".$_POST['skills']."',mysqli_insert_id()); "; //what happens when successful or not if( $mysqli->query($query) ) { echo $query ; echo "Character was approved."; }else{ echo "Database Error: Unable to update record."; echo $mysqli->errno; echo mysqli_error($mysqli); } } //what happens when successful or not if( $mysqli->query($query1) ) { echo $query1 ; echo "Character was approved."; }else{ echo "Database Error: Unable to update record."; echo $mysqli->errno; echo mysqli_error($mysqli); }