hi
thanks for that it worked.
would you have any idea how to do the same with a new user whose id is only generated when they register. i would like to use the same insert query though.
here is the qry that i have
$insert = "insert into tickettbl (AccID, ChrgID, TicketNo, TimeData, RecDate)
values ('$AccID', '$row->ChrgID', '$Random', '$OptionFrm', '$TodaysDate')";
it can be done if in the values section of query i change $AccID to LAST_INSERT_ID().
i need to somehow get the AccId from new record on store it in $AccID