Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 01-16-2005, 10:39 PM   #1
kemp
Confirmed User
 
Join Date: Feb 2001
Location: Utopia
Posts: 392
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...
kemp is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-16-2005, 10:43 PM   #2
Crypt
Confirmed User
 
Join Date: Apr 2004
Posts: 2,225
Put a special flag in a field when you use it the first time
Crypt is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-16-2005, 11:01 PM   #3
Varius
Confirmed User
 
Industry Role:
Join Date: Jun 2004
Location: New York, NY
Posts: 6,890
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.
__________________
Skype variuscr - Email varius AT gmail
Varius is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-16-2005, 11:03 PM   #4
woj
<&(©¿©)&>
 
woj's Avatar
 
Industry Role:
Join Date: Jul 2002
Location: Chicago
Posts: 47,882
Quote:
Originally Posted by Varius
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.
True, in most cases, using mysql query is better than picking random in php code.
__________________
Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000
Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager
Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager
woj is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-16-2005, 11:49 PM   #5
kemp
Confirmed User
 
Join Date: Feb 2001
Location: Utopia
Posts: 392
Thanks guys. My knowledge on the subject is a little thin so your advice will certainly help make my new tgp more productive!
kemp is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.