![]() |
php or mysql?
I have a mysql table filled with crap. I need to pull random lines from this table making sure that each time I query a line that is can not be queried again.
Which is better, doing it all as a mysql statement, or doing it inside of php? Either way I will have to figure out the method to do it, but maybe one of you php pros can point me in the right direction so I learn the right one first...:) |
Put a special flag in a field when you use it the first time
|
Done right, you should always opt for doing it in mysql when you can as oppoed to in php.
For example, you might be pulling all your rows into an array and then picking out a random one in php....It's much more effective to use Mysql's function RAND instead in your actual query. |
Quote:
|
Thanks guys. My knowledge on the subject is a little thin so your advice will certainly help make my new tgp more productive!
|
All times are GMT -7. The time now is 05:31 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123