Technology : General Technology Notes: Diary of a late,late adopter.
Updated: 2/10/2004; 12:29:55 PM.

 

Ask....
Frequent Visits
Categories
Other

Subscribe to "Technology" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.

 
 

Saturday, January 31, 2004

I like the PHP function mysql_insert_id( ) .  I just found out about it.  It is good for when you just inserted on one table and you want to insert the autogenerated primary key into another table.  Almost serves as the equivalent of an Oracle sequence object, but not quite.

Works as follows

[ME]:  Damn.  I wonder how to find the user ID  for the brand new user without doing another query?

[Narrator from Dukes of Hazzard]:  "Well, son just try  $user_id = mysql_insert_id(); "


9:01:06 PM    comment []

© Copyright 2004 mcgyver5.



Click here to visit the Radio UserLand website.

 


January 2004
Sun Mon Tue Wed Thu Fri Sat
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Dec   Feb