Lifelesspeople.com

 Forum FAQsForum FAQs  Knowledge BaseKnowledge Base  RulesRules   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   HostingHosting   RegisterRegister 
 DonateDonate   WikiWiki   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

sql query picking up rows it shouldn't

 
Lifelesspeople.com Forum Index -> Web Architects' Abode
Post new topic   Reply to topic View previous topic :: View next topic  
Author Message
Desbrina
Jadeite


Joined: 11 Jun 2005
Posts: 3001
Location: Earth

PostPosted: Sat Jan 19, 2008 10:48 am    Post subject: sql query picking up rows it shouldn't Reply with quote

Code:
$sql = "SELECT *
      FROM `auction_items`
      WHERE `processed` = 0
      AND `item1` LIKE '%".mysql_real_escape_string($_POST['criteria1'])."%'
      OR `item2` LIKE '%".mysql_real_escape_string($_POST['criteria1'])."%'
      OR `item3` LIKE '%".mysql_real_escape_string($_POST['criteria1'])."%'
      OR `item4` LIKE '%".mysql_real_escape_string($_POST['criteria1'])."%'
      ORDER BY EndDate";


That sql query is picking up rows where processed is equal to 1 which it shouldn't be doing. How do i make it so that it only picks up rows that have processed set to 0?
_________________
Midnight Tempest - A Sailor Moon TCG
Balanced Force - A Star Wars TCG
Caretaker - A Star Trek Voyager TCG
My Stories
Back to top
 
nooc
Master Poster


Joined: 10 Aug 2005
Posts: 215


PostPosted: Sat Jan 19, 2008 11:22 am    Post subject: Reply with quote

Perhaps you want to put everything after AND inside parenthesis.
Back to top
 
Desbrina
Jadeite


Joined: 11 Jun 2005
Posts: 3001
Location: Earth

PostPosted: Sat Jan 19, 2008 11:38 am    Post subject: Reply with quote

thanks, works perfectly
_________________
Midnight Tempest - A Sailor Moon TCG
Balanced Force - A Star Wars TCG
Caretaker - A Star Trek Voyager TCG
My Stories
Back to top
 
Display posts from previous:   
Post new topic   Reply to topic    Lifelesspeople.com Forum Index -> Web Architects' Abode All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Home | Hosting | News | Forum | Links | System Status | About | Archive | Donate ]
Powered by phpBB © 2001, 2002 phpBB Group
All trademarks and copyrights on this page are owned by their respective owners. Posts and comments are owned by the poster. Everything else © 2001 - 2007 Lifelesspeople.com