Im trying to get the id that i just created in my register page and pass it to the second page which is mahai.php which this page will get the last id(new created record) and show the details of the last id. I had tried different kinds of way passing the id but the end the mahai.php?= behind is empty and this current code is having fatal error on the query I need help and recommendation in enhance my code
$connect = mysql_connect("localhost","root","","phplogin");
$queryreg = mysql_query("INSERT INTO event VALUES('','$uid','$etittle','$ebuilding')");
if ($connect->$queryreg===TRUE){
$last_id = $conn->insert_id;
header("Location:mahai.php?id=".$last_id);
}else{
echo "fail";
}