I love this list! That's perfect! I was able to simplify the function down even more.
Thanks a lot, Craig > -----Original Message----- > From: Matt Matijevich [mailto:[EMAIL PROTECTED] > Sent: January 26, 2004 4:01 PM > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: Re: [PHP] random alphanumeric value generator > > > 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