PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
me!
Forum Contributor
Posts: 133 Joined: Sat Nov 04, 2006 8:45 pm
Post
by me! » Mon May 28, 2012 9:26 pm
it all works except the
WHERE asking_price >= '10.00'
Code: Select all
$sql = "SELECT * FROM equipment WHERE asking_price >= '10.00' AND sold_for = '0.00' AND sold_to = '' ORDER BY asking_price DESC LIMIT 3";
So what did I screw up?
Christopher
Site Administrator
Posts: 13596 Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US
Post
by Christopher » Mon May 28, 2012 10:25 pm
What type of field is asking_price? If it is not a CHAR/VARCHAR then it should be "asking_price >= 10.0"
(#10850)
me!
Forum Contributor
Posts: 133 Joined: Sat Nov 04, 2006 8:45 pm
Post
by me! » Mon May 28, 2012 10:54 pm
asking_price and sold_for are decimal(11,2)
me!
Forum Contributor
Posts: 133 Joined: Sat Nov 04, 2006 8:45 pm
Post
by me! » Mon May 28, 2012 11:11 pm
changed it to this but it still is not doing asking_price correct.
Code: Select all
$sql = "SELECT * FROM equipment WHERE asking_price >= 10.00 AND sold_for = 0.00 AND sold_to = '' ORDER BY asking_price DESC LIMIT 3";
me!
Forum Contributor
Posts: 133 Joined: Sat Nov 04, 2006 8:45 pm
Post
by me! » Mon May 28, 2012 11:20 pm
Ah! now I see my problem... "LIMIT 3" oops!