Solved

sql where issue

Posted on 2011-09-09
3
183 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
3 Comments
 
LVL 19

Assisted Solution

by:Limbeck
Limbeck earned 250 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 250 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

708 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now