$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);
How do I get this AUTO INCREMENT that was generated by MySQL? I've tried this but it doesn't work:
$statement = $mysqli->query($insert);
echo $statement->insert_id;
You can get the auto_increment value with
See mysqli_insert_id for more info.
Insert id is a property of the MYSQLI object and not the MYSQLI result object:
http://php.net/manual/en/mysqli.insert-id.php