Quick PHP/mySQL question

Modeps

Lifer
Oct 24, 2000
17,254
44
91
Alright, I've got a private message system on my site. I'm trying to alert the user to how many "new" message they have... the unread messages have a database field "Read" set as a default of "0000-00-00". So, it would be simple to just select everything except those right?

SELECT *
FROM Message
WHERE Read <> "0000-00-00"

Right?

It's not working... :( Gimme a hand please?
 

Armitage

Banned
Feb 23, 2001
8,086
0
0
I assume the read field has a column type of DATE?
In any case, I just ran a quick test, and all three (<>, >, !=) work fine from the MySQL commandline

 

Modeps

Lifer
Oct 24, 2000
17,254
44
91
I'm now wondering if Read is a reserved word.
nm: I must have had a lapse of stupidity... I got it. (was checking the wrong column... i guess that's what happens when you've been coding all day)
 

Armitage

Banned
Feb 23, 2001
8,086
0
0
Originally posted by: Modeps
I'm now wondering if Read is a reserved word.
nm: I must have had a lapse of stupidity... I got it. (was checking the wrong column... i guess that's what happens when you've been coding all day)

Actually, I'd say you had a lapse of intelligence - the stupid bit seems to be set :p
Been there done that!
 

Modeps

Lifer
Oct 24, 2000
17,254
44
91
Originally posted by: Armitage
Originally posted by: Modeps
I'm now wondering if Read is a reserved word.
nm: I must have had a lapse of stupidity... I got it. (was checking the wrong column... i guess that's what happens when you've been coding all day)

Actually, I'd say you had a lapse of intelligence - the stupid bit seems to be set :p
Been there done that!

haha yeah, :) thanks for all your help