Easy Mysql Question....
Posted: Sat Apr 01, 2006 3:29 pm
Hi fella's,
I'm coding in php and mysql and it's been a while since I've used mysql, I'm just a bit rusty.
I need to grab 10 rows from a mysql table at random, then mark them as grabbed.... How would I grab at random and NOT pull the entire db into a array ? Efficiency is key! This is a rather large db.
That's what I got so far
XXXXXX being what I'm missing.....
Thanks in advance!
oh yea, one more easy question I forgot....
I'm using the DATETIME ( http://dev.mysql.com/doc/refman/5.0/en/datetime.html ) variable for a row in this table called, date ,how original, anyways, how can I call rows that are AT LEAST 72 hours since the last time I called them ?
Here's what I got...
This is the date format I THINK I'm going to use unless anyone can give me advice..
Thanks again, boy am I rusty with mysql...
I'm coding in php and mysql and it's been a while since I've used mysql, I'm just a bit rusty.
I need to grab 10 rows from a mysql table at random, then mark them as grabbed.... How would I grab at random and NOT pull the entire db into a array ? Efficiency is key! This is a rather large db.
That's what I got so far
Code: Select all
SELECT * FROM `$table` XXXXXXXXXX, LIMIT = 10;XXXXXX being what I'm missing.....
Thanks in advance!
oh yea, one more easy question I forgot....
I'm using the DATETIME ( http://dev.mysql.com/doc/refman/5.0/en/datetime.html ) variable for a row in this table called, date ,how original, anyways, how can I call rows that are AT LEAST 72 hours since the last time I called them ?
Here's what I got...
Code: Select all
WHERE date>=WHATHERE?Code: Select all
date("Y-m-d G:i:s");