General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old April 11th, 2003, 10:19 AM
fearx24 fearx24 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 9 fearx24 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
SQL query? Help with multiple fields LIKE, NOT LIKE, OR

I want to setup a query that searches different fields using options such as LIKE, NOT LIKE, and OR. Is OR an option for queries. I can get it to search between the 2 dates like I want and pick all records in the field GroupSess that arent "None".

PHP Code:
 $query "SELECT * FROM records WHERE ".date." BETWEEN '%".$thedate."%' AND '%".thedate1."%' AND
"
.GroupSess." NOT LIKE 'None' "


But how do I go further with this like if the GroupSess field is blank in the record I dont want it to show up on query, so I tried this and didnt work

PHP Code:
 $query "SELECT * FROM records WHERE ".date." BETWEEN '%".$thedate."%' AND '%".thedate1."%' AND
"
.GroupSess." NOT LIKE 'None' OR NOT LIKE ' ' "


Thanks Nick

Reply With Quote
  #2  
Old April 14th, 2003, 09:54 AM
torrent torrent is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 19 torrent User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
PHP Code:
 $query "SELECT * FROM records WHERE ".date." BETWEEN '%".$thedate."%' AND '%".thedate1."%' AND
"
.GroupSess." NOT LIKE 'None' AND ".GroupSess." IS NOT NULL; 

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > SQL query? Help with multiple fields LIKE, NOT LIKE, OR


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap