Solved

sql where issue

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Use Select Query to Return Results as a Form 9 43
Wordpress and Wufoo 1 39
A responsive image gallery using flexbox 6 23
Why is my implode function empty 8 18
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.

726 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