$insert = "INSERT INTO event_tracker_table (event_name, event_location, location_number, event_creator_username, event_creator_email)
VALUES (
'".$_POST['event_name']."',
'".$_POST['event_location']."',
'".$_POST['location_number']."',
'".phpCAS::getAttribute('uid')."',
'".phpCAS::getAttribute('mail')."'
)";
$mysqli->query($insert);
如何获得由 MySQL 生成的这个 AUTO INCREMENT?我已经尝试过了,但它不起作用:
$statement = $mysqli->query($insert);
echo $statement->insert_id;