The simplest way of selecting random rows from the MySQL database is to use “ORDER BY RAND()” clause in the query.
Solution 1 [SQL QUERY]
SELECT * FROM `table` ORDER BY RAND() LIMIT 0,4;
This query select 4 random value every refresh?
The problem with this method is that it is very slow. The reason for it being so [...]
Posts Tagged ‘return data’
Select random value from MySQL database table.
Posted in MySql, PHP, tagged Database, function, My Blog, MySql, PHP, rand(), random, random value, return data, table on March 25, 2009 | 7 Comments »
Read & Return Data From Files Into PHP
Posted in PHP, tagged file read, PHP, return data on March 16, 2008 | Leave a Comment »
Reading File Data
If you have written data to a file from PHP, or you have a file on your server you need to read with PHP, there are quite a few ways you can do it. The four ways we will cover here are fread (), fgets (), file (), and file_get_contents(). The one you [...]