Results 1 to 12 of 12
Jul 24, 2009, 14:00 #1
- Join Date
- Aug 2006
- 0 Post(s)
- 0 Thread(s)
Generating code and checking against DB
I'm working on a db entry script that generates a 6-character code, checks to see if that code is in the db already, and re-generates the code if it's found.
This is probably pretty simple, and I think I have a working solution but I'd like to have some other eyes look at it.
//$code = strtoupper(genCode(6));
$code = 'ABCDEF';
$query = "SELECT clientcode ";
$query .= "FROM clients ";
$rows = $dbh->query($query);
foreach($rows as $row)
$code = strtoupper(genCode(6));
Thanks for any advice.No, I REALLY dislike having to use Joomla.