wana
|
Posted: 04/26/2002, 9:58 PM |
|
Anyidea how could do the following in PHP code
pkSQL = "select max(category_id) as lastpk from categories"
openrs rs1, pkSQL
last = GetValue(rs1, "lastpk")
last_value = dlookup("categories","name","category_id=" & last)
sActionFileName=sActionFileName & "?last_pk=" & last & "&last_value=" & last_value
rs1.close
|
|
|
L1LxDRA60N
|
Posted: 04/27/2002, 3:05 AM |
|
$last=mysql_insert_id ();
// Obtains last generated autoincrement value...
// It's either this or the MySQL query - SELECT LAST_INSERT_ID() FROM categories
$compare="category_id=" . $last;
// Compare statement for the dlookup function
$last_value=dlookup("categories","name",$compare);
$sActionFileName .= "?last_pk=" . $last . "&last_value=" . $last_value;
I don't know if this is what you want based on the ASP code you supplied but let me know if this works.
|
|
|
Rob
|
Posted: 10/24/2003, 4:48 PM |
|
Worked for me (CC)!
From the article that was for asp = http://gotocode.com/art.asp?art_id=146&
This one does work for php in the Newrecord.php page, on the form/after insert.
Thanks, a whole 18 months later!
Robert
|
|
|
|