» Quick Links
You can make money on these forums
We Share profits with you
Google
Google Adsense
Google Adwords
YPN
Yahoo
MSN Search
Web Directories
Web Hosting
Web Hosting Offers
Hosting News
Suggestions
Link Building
Domain Names
PHP Forums
MySQL Forums
» More Links
OSP News
Reseller Hosting
Shared Hosting
Dedicated Servers
Google Adsense
Search Engine Marketing
Link Development
Affiliate Marketing


» Advertising
Multiple DC PR Check

Free SEO Tools


Go Back   Webmaster Forums > Website Developement / Programming > MySQL Forums

MySQL Forums Share Your Ideas and Tips about MYSQL. Ask questions about MYSQL. Table Design and Much More...

Reply
 
Thread Tools Display Modes
  #1  
Old 08-08-2006, 09:34 AM
Wade Wade is offline
Junior Member
 
Join Date: Aug 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
Wade is on a distinguished road
Default logical operators issue?

Hello,
I have a query about 17'000 characters long being glued together from a php-script. It is basically a select over a few tables using joins with some "where"-clauses and alot of "OR" clauses.

Example: and t6.fir="480" or t6.sod1a=8329 and t6.fir="480") or (t6.soc1a=11071 and t6.fir="490" or t6.son1a=11071 and t6.fir="490" or t6.sod1a=11071 and t6.fir="490") or (t6.soc1a=5009 and t6.fir="666" or t6.son1a=5009 and t6.fir="666" or t6.sod1a=5009 and t6.fir="666") or (t6.soc1a=4677 and t6.fir="450" or t6.son1a=4677 and t6.fir="450" or t6.sod1a=4677 and t6.fir="450") or ...

basically the problem can be reduced to this sample query

Select A from table where B=1 and C=2 or D=4 or E=5 or F=6

so, which of the hundreds of OR-clauses did trigger. Is there any way to find out which field trigge -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Revenue Sharing Ads ( ?):
  #2  
Old 08-08-2006, 09:36 AM
Hary Hary is offline
OSP Starters
 
Join Date: Aug 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
Hary is on a distinguished road
Default

You can turn a series of logical expressions into a bitfield:

SELECT A, CONV(CONCAT(b=1, c=2, d=4, e=5, f=6), 2, 2)
FROM table WHERE B=1 AND C=2 OR D=4 OR E=5 OR F=6 -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
any issue with this reseller account? MEddie Reseller Hosting Forum 1 11-22-2006 04:18 AM
Adsense issue?? Pyusch Web Hosting Industry 1 11-18-2006 04:35 AM
diskspace issue! lizpreet Dedicated Servers 1 10-10-2006 04:52 AM
Mysql_fetch_array issue, parsing most likely the issue cisco PHP Programming and Tips 1 08-28-2006 02:44 PM
multiple fields issue!! Gillian MySQL Forums 1 08-03-2006 10:28 AM


All times are GMT. The time now is 08:35 PM.