mysqli auto incremented primary id that was generated

前端 未结 2 966
不知归路
不知归路 2021-01-20 14:48
$insert = \"INSERT INTO event_tracker_table (event_name, event_location, location_number, event_creator_username, event_creator_email)

            VALUES (
                 


        
2条回答
  •  星月不相逢
    2021-01-20 15:17

    Insert id is a property of the MYSQLI object and not the MYSQLI result object:

    $statement = $mysqli->query($insert);
    echo $mysqli->insert_id; // correct
    echo $statement->insert_id; //not correct
    

    http://php.net/manual/en/mysqli.insert-id.php

提交回复
热议问题