Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

sql where issue

Posted on 2011-09-09
3
Medium Priority
?
224 Views
Last Modified: 2012-08-14
See my below code:

WHERE td.call_back_id = ".$row_rs_call_back_request['id']." AND td.hide_comment IS NULL OR td.hide_comment = 'No'";

I must be writing it incorrectly as I am not getting the correct result.

I basically want the code after the AND grouped.

i.e.

td.call_back_id = ".$row_rs_call_back_request['id']."

AND

(td.hide_comment IS NULL OR = 'No')

I have just put bracket to separate and try to explain what I require, but not sure how to write.

How it makes sense. Ask if not?

0
Comment
Question by:petewinter
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 19

Assisted Solution

by:Limbeck
Limbeck earned 1000 total points
ID: 36510188
hi how about

WHERE td.call_back_id = ".$row_rs_call_back_request['id']." AND ((td.hide_comment IS NULL) OR (td.hide_comment = 'No'))";
0
 
LVL 8

Accepted Solution

by:
Rik-Legger earned 1000 total points
ID: 36510195
WHERE td.call_back_id = ".$row_rs_call_back_request['id']." AND (td.hide_comment IS NULL OR td.hide_comment = 'No');

Open in new window

0
 

Author Closing Comment

by:petewinter
ID: 36510274
So Simple... Many thanks :)
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

660 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question