Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.
Moderator: General Moderators
pelegk2
Forum Regular
Posts: 633 Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:
Post
by pelegk2 » Tue Feb 17, 2004 3:18 am
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
patrikG
DevNet Master
Posts: 4235 Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK
Post
by patrikG » Tue Feb 17, 2004 3:24 am
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.).
pelegk2
Forum Regular
Posts: 633 Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:
Post
by pelegk2 » Tue Feb 17, 2004 3:44 am
the date=
i did the same welect with date='' and it didnt work!
patrikG
DevNet Master
Posts: 4235 Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK
Post
by patrikG » Tue Feb 17, 2004 3:50 am
Can you post your SQL statement please, and the table structure?
Thanks
patrikG
DevNet Master
Posts: 4235 Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK
Post
by patrikG » Tue Feb 17, 2004 4:50 am
Btw.: Does the date-column default to 0 (since it's integer)?
pelegk2
Forum Regular
Posts: 633 Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:
Post
by pelegk2 » Tue Feb 17, 2004 5:50 am
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