我正在尝试从先前的查询中提取自动递增的 id。我收到异常:1305 FUNCTION THE_NAME_OF_MY_DATABASE.mysqli_insert_id 不存在。
- 这不可能是语法错误吗?
我在哪里可以更改 mysql 以具有此功能或需要改写什么?我用谷歌搜索了这个,发现反应不一。
$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); }