ohdang888 Posted July 5, 2008 Share Posted July 5, 2008 $mb = mysql_query("SELECT * FROM `message_board`,`message_read` WHERE message_board.per_code='$rep_p' AND (message_board.state='$rep_state' OR message_board.state='ALL') AND ( if(message_read.u_id ='$user')!= `message_read.m_id` != `message_board.id`) ")or die(mysql_error()); this part is my trouble... AND ( if(message_read.u_id ='$user')!= `message_read.m_id` != `message_board.id`) ")or die(mysql_error()); the way the message board is set up, is that once a user reads it, they click "mark as read" and message_read gets a new row of the user id and the message id... so if they have marked it as read, do not display... thats what i want to acheive here AND ( if(message_read.u_id ='$user') then `message_read.m_id` != `message_board.id`) ")or die(mysql_error()); if there is a row insert with their user id, then the message is cannot equal the messsage id that they qualify for, up until that little piece of the code... Thanks. Link to comment https://forums.phpfreaks.com/topic/113352-is-statements-in-query/ Share on other sites More sharing options...
ohdang888 Posted July 6, 2008 Author Share Posted July 6, 2008 rump de bump Link to comment https://forums.phpfreaks.com/topic/113352-is-statements-in-query/#findComment-582864 Share on other sites More sharing options...
fenway Posted July 6, 2008 Share Posted July 6, 2008 Explain that again... Link to comment https://forums.phpfreaks.com/topic/113352-is-statements-in-query/#findComment-583058 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.