Re: WHERE problem

From: Date: Tue, 20 Feb 2007 09:33:29 +0000
Subject: Re: WHERE problem
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-249068@lists.php.net to get a copy of this message
How about this instead, Mike? <?php // some code $fortune = mysql_query("SELECT text FROM fortunes ORDER BY RAND() LIMIT 1"); $fortune = mysql_fetch_row($fortune); $fortune = sprintf( '<span class="quotecyc">&quot;%s&quot;<br />-Omniversalism.com</span>', $fortune[0] ); // some more code ?> MySQL is implemented in random code, so it can probably perform this operation faster, and this code is much cleaner. You may want to move away from mysql since it's essentially deprecated. I have switched to mysqli and prefer it.

« previous php.general (#249068) next »