CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 convert the following to php

Print topic Send  topic

Author Message
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

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.