Solved

sql where issue

Posted on 2011-09-09
3
188 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Problem with Simple PHP/mySQL Query 3 51
updating table data with inner join 9 24
Access Object's Property 9 22
Sql query on a varchar that is numeric. 8 24
Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

911 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

20 Experts available now in Live!

Get 1:1 Help Now