Jump to content

help with my query.. thanx in advance


DanDaBeginner

Recommended Posts

what is the problem with my query? even if the del_id = 1 it display.. if you can see "del_id <> 1" a row that has a del_id =1 should not be display but when I run myscript it still displaying..I already tried del_id != 1 but still the same error occured..

Any help is greatly appreciated..

 

$query_chk_msg = mysql_query("SELECT

del_id,message_content

FROM

table_message

WHERE

(sender_id = 3

AND

recepient_id = 1)

OR

(sender_id =1

AND

recepient_id = 3)

AND

del_id <> 1

");

Link to comment
https://forums.phpfreaks.com/topic/40162-help-with-my-query-thanx-in-advance/
Share on other sites

Try putting the two "OR"s in between parentheses:

$query_chk_msg = mysql_query("SELECT
                  del_id,message_content
                  FROM
                  table_message
                  WHERE
                  ((sender_id = 3
                  AND
                  recepient_id = 1)
                  OR
                  (sender_id =1
                  AND
                  recepient_id = 3))
                  AND
                  del_id <> 1
                           ");

 

Orio.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.