strange problem with SELECT

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

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:

strange problem with SELECT

Post by pelegk2 »

i have this select :

Code: Select all

SELECT * FROM order_h WHERE del_id>0 and (dt<=1093557599 AND dt>=1093471200 AND TEUDAT_MISH='') OR FROM_UNIXTIME(TAARICH_T,'%Y %d %m')=FROM_UNIXTIME(UNIX_TIMESTAMP(),'%Y %d %m') order BY region_id asc
the problem is that i ask for all the del_id>0 but for some strange reason i get del_id==0 !!!! why is that ?>
del_id is defind as int unsigend not null
what wrong
bugthefixer
Forum Contributor
Posts: 118
Joined: Mon Mar 22, 2004 2:35 am

Post by bugthefixer »

try this

Code: Select all

SELECT * FROM order_h WHERE del_id>0 and (dt<=1093557599 AND dt>=1093471200 AND TEUDAT_MISH='') AND FROM_UNIXTIME(TAARICH_T,'%Y %d %m')=FROM_UNIXTIME(UNIX_TIMESTAMP(),'%Y %d %m') order BY region_id asc
OR is replaced with AND
?>
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:

Post by pelegk2 »

now i get 0 results which immpossible
ody
Forum Contributor
Posts: 147
Joined: Sat Mar 27, 2004 4:42 am
Location: ManchesterUK

Post by ody »

some sample data would'nt go amiss..
Post Reply