I am trying to insert an auto_increment value into multiple tables but its seems to lose its value after the the second insert statement and my code is as follows can any1 please help. The auto_increment value that i want to use is the one from the client table and it will insert in the CONTACTS table but it will not in the JOBSHEET and KNOWLEDGE table. last_insert_id() has not worked because i have auto increment fields in all the tables pliz pliz help
mysql_query("INSERT INTO CLIENT VALUES(
NULL, '$companyname', '$contactname', '$siteaddress', '$phonenumber', NULL, '$website', '$code', '$postaladdress')") or die (mysql_error());
mysql_query('SET @clientID = last_insert_id()') or die (mysql_error());
mysql_query("INSERT INTO CONTACTS VALUES( NULL, '@clientID' )") or die (mysql_error());
mysql_query("INSERT INTO JOBSHEET VALUES( NULL, '@clientID')") or die (mysql_error());
mysql_query("INSERT INTO KNOWLEDGE VALUES( NULL, '@clientID', '$categoryID', '$staffID', '$knowledge')") or die (mysql_error());