hi guys
i would appriciate your coments on this code - when i ran it for the very first time it doesnt see @last = LAST_INSERT_ID() but when i ran it next time it read it properly i need to know it imiedietely after i insert value into session1...
is there any other way to do it? insert into 2 tables at the same time ...?
[PHP]
if(!($sessid)){
session_register('sessid');
mysql_query("insert into session1 set
sessid=null,
ip='$ip',
ip2='$ip2',
cook=$cook,
time='$time',
user='$Guser',
pass='$pass',
ile='0'
");
//this doesnt work imiedietly last=0 - next time i run the script its ok ..
//it doesnt seem to see that i did inserted a values into session1.
$id5=mysql_query("SELECT @last := LAST_INSERT_ID()");
$sessid1=mysql_fetch_array($id5);
$sessid=$sessid1[0];
mysql_query("insert into session2 set
sessid=@last,
browser='$GLOBALS[HTTP_USER_AGENT]',
lang='$GLOBALS[HTTP_ACCEPT_LANGUAGE]',
host='$GLOBALS[HTTP_HOST]',
accept='$GLOBALS[HTTP_ACCEPT]',
referer='$GLOBALS[HTTP_REFERER]',
");
}[/PHP]
thanks a lot
jx2