small seelct help

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
pelegk2
Forum Regular
Posts: 633
Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:

small seelct help

Post by pelegk2 »

i am making a select
and i want to select all the worws that the
col name date is empty! (nothing written there!!)
the dat col is of type : int(11) unsigned
and when i try in the select
where date=null
OR
where date=0
or
WHERE
date=''
none of this helps!
thanks in advance
peleg
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

SELECT * FROM myTableName WHERE date=""

Note that, depending on which database you're using the column-name can be case-sensitive (e.g. it could be "Date" or "DATE" etc.).
User avatar
pelegk2
Forum Regular
Posts: 633
Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:

i dont understand what u did where

Post by pelegk2 »

the date=

Code: Select all

date=""
i did the same welect with date='' and it didnt work!
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

Can you post your SQL statement please, and the table structure?

Thanks
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

Btw.: Does the date-column default to 0 (since it's integer)?
User avatar
pelegk2
Forum Regular
Posts: 633
Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:

this is the select

Post by pelegk2 »

Code: Select all

select * from myDb where id=7 and done_date=''
and not its not default zero and i cantchange it to zero now
Post Reply