PDA

View Full Version : Pulling all data from specific month


curb
11-02-2006, 01:06 AM
I want to pull out all the data entries I've made for a specific month by using a $_GET method (archived.php?month=october). My field time rows look like "1161065143".

How can I do a mysql_query for this?

Here's what I have so far:

mysql_query("SELECT * FROM entrynote WHERE time = '$date' SORTED BY time DESC

Fumigator
11-02-2006, 01:42 AM
What type is the time field? (i.e. char, varchar, int, date, time, timestamp, datetime, etc)

curb
11-02-2006, 01:53 AM
int(255)

guelphdad
11-02-2006, 05:51 PM
I'll guess that it is UNIXTIME you are using there:


select
foo,
bar,
qux
from yourtable
where
month(from_unixtime(yourdatefield)) = 10