I've read through the mysql manual but they don't have much info on last_insert_id
anyone know what I'm doing wrong? when I echo the session variable its always 0
Code: Select all
<?php
// ENTER USER IN DATABASE
$result = query_db("INSERT INTO customers (cust_first,cust_last,cust_email) "
."VALUES ('".$_POSTї'f_first']."', '".$_POSTї'f_last']."','".$_POSTї'f_email']."')");
// REGISTER SESSION VARIABLES
$_SESSIONї'user_id'] = query_db("SELECT last_insert_id()");
?>