This topic is locked

How To Get Next Auto Key Through Button?

1/8/2013 4:21:20 AM
PHPRunner General questions
T
Tayyab Ilyas author

Hi

I have a table with Auto Increment Primary Key

How can i get next auto key through a button?
Actually what i am trying to achieve is that i need to insert data in child table but before child i need to have mater table key which is not generated before inserting data so i want to first get next auto key and then insert the same key (AS FK) + child data into child table.

Thanks for support

C
cgphp 1/8/2013

You can embed the needed code in the "After record added" event of the master table. To access specific key column value, use:

$keys["KeyFieldName"]



where KeyFieldName is the real name of the primary key on the master table.
You can find more info here: http://xlinesoft.com/phprunner/docs/after_record_added.htm