I use a function, myrandomPIN (), to generate random PIN numbers.
The following sql query updates records with the SAME PIN number but.
I want to generate DIFFERENT pin numbers for every record. The
function is ok but I can't figure out how to run it individually for
each record. In other words I do not know the correct syntax to use
UPDATE in a loop (if necessary) so that a different call to the
function is done every time or ecah record ends up with a different
PIN.
Or may be this can be done with a single mysql_query($sq l2)???
----------------------------------------------------------------------------
$qr = @mysql_query($s qlb1) or die("ERROR");
$rs1 = mysql_fetch_arr ay($qr);
$thepin=myrando mPIN();
$sql2="UPDATE clients SET pin='$thepin' WHERE code='".$thecod e."'";
$qr = @mysql_query($s ql2) or die("ERROR"");
--------------------------------------------------------------------------
Thanks
The following sql query updates records with the SAME PIN number but.
I want to generate DIFFERENT pin numbers for every record. The
function is ok but I can't figure out how to run it individually for
each record. In other words I do not know the correct syntax to use
UPDATE in a loop (if necessary) so that a different call to the
function is done every time or ecah record ends up with a different
PIN.
Or may be this can be done with a single mysql_query($sq l2)???
----------------------------------------------------------------------------
$qr = @mysql_query($s qlb1) or die("ERROR");
$rs1 = mysql_fetch_arr ay($qr);
$thepin=myrando mPIN();
$sql2="UPDATE clients SET pin='$thepin' WHERE code='".$thecod e."'";
$qr = @mysql_query($s ql2) or die("ERROR"");
--------------------------------------------------------------------------
Thanks
Comment