This topic is locked

Page on Load

6/29/2006 3:42:48 AM
PHPRunner General questions
D
dieter author

Can I preview the current ID for the new Record on the Add page in a field ?
Dieter

Alexey admin 6/29/2006

Dieter,
there is no reliable method to do this.
Here is the rough method for achieving the next ID.

Put this code into AddOnLoad event:

global $conn;

$rs=db_query("select max(ID) from YourTable",$conn);

$data=db_fetch_numarray($rs);

$nextid=$data[0]+1;

echo "The next ID is ".$nextid;



where YourTable and ID are your actual table and field names.