Auto Generating a Number and Insert into Field

Tips submitted by PHPMaker users

Auto Generating a Number and Insert into Field

Postby mrcali » Sun Oct 09, 2016 4:48 pm

Hello,

Here's a tip on how to auto generate a number and inserted it into a hidden field when you are making a new record, this is basic stuff but it is not readily apparent in the manual. Put this in the Row Inserting section of the Server Scripts, Client Scripts and Custom Templates Tab. Also make sure not to make the field editable if you never want to change the randomly generated number.

$randomnumber = rand();
$rsnew['fieldname']="$randomnumber";
mrcali
 
Posts: 8
Joined: Fri Oct 07, 2016 3:48 pm

Return to User Submitted Tips (PHPMaker)