because it is MySQL, couldn't you just use mysql_insert_id http://www.php.net/manual/en/function.mysql-insert-id.php instead of this:
//now get the random number, and MD5 it to get it alphanumeric $query = 'SELECT MAX(uiIndex), cKey FROM randomKey GROUP BY cKey'; $result = mysql_query($query, dbConnect($errorMsg)); $row = mysql_fetch_object($result); use this return md5(mysql_insert_id()); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php