Jump to content

generate a random id # to pull out of mysql db?


izbryte

Recommended Posts

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?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.