Hi ,
I am having problem in inserting the data into the database.
I have a table with the following format:
IWPSD_PERSONAL
Field Name Type
visitor_id Int(11) auto_increment
title varchar(10)
name varchar(60)
address varchar(150)
phone varchar(30)
fax varchar(30)
email varchar(40)
the code that is not workin ........
(I am pasting a part of it...)
$query= "INSERT DELAYED INTO IWPSD_PERSONAL(visitor_id,title,name,address,phone,fax,email) VALUES ('$title','$name','$address','$phone','$fax','$email')";
mysql_query($query);
$NextID= mysql_insert_id()
if (isset($chk1))
{
$query1 = "INSERT DELAYED INTO IWPSD_OPTION VALUES ('$NextID','$chk1')";
mysql_query($query1);
}
if (isset($chk2))
{
$query2 = "INSERT DELAYED INTO IWPSD_OPTION VALUES ('$NextID','$chk2')";
mysql_query($query2);
}
if (isset($chk3))
{
$query3 = "INSERT DELAYED INTO IWPSD_OPTION VALUES ('$NextID','$chk3')";
mysql_query($query3);
}
mysql_close();
In this code $NextID= mysql_insert_id() generates a zero, whereas it should give me the auto_increment value that is being generated.
Can anybody help me with this. ..........?????