izbryte Posted February 13, 2008 Share Posted February 13, 2008 I have a script: $query = "SELECT * FROM firms ORDER BY firmID DESC LIMIT 1"; $result = @mysql_query ($query); // Run the query. while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { echo '(firm info.. blah.. blah)'; which obviously results in showing the last firm entered. What I'd like to do is select a random firmID each time the script is run. Can anyone help me with that? Link to comment https://forums.phpfreaks.com/topic/90991-generate-a-random-id-to-pull-out-of-mysql-db/ Share on other sites More sharing options...
awpti Posted February 13, 2008 Share Posted February 13, 2008 Look up RAND() in mysql. Link to comment https://forums.phpfreaks.com/topic/90991-generate-a-random-id-to-pull-out-of-mysql-db/#findComment-466350 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.