Jump to content

[SOLVED] Mysql syntax


dhimok

Recommended Posts

Hi everyone.

 

I want to select from a table where id = querystring and status = 1 and amount is either greater then 0 or like 'unlimited'

 

I tried to use this syntax

 


$result = dbQuery("SELECT * FROM tbl WHERE category_id = '".$cat."' 
	AND status = '1' AND amount > 0 OR amount LIKE '%unlimited%'  
	ORDER BY sort_order ASC");

 

If i use  LIKE '%unlimited%' i get the results repeating themselves. So its not working.

Any help on how to get all params

 

Thanks

 

Link to comment
https://forums.phpfreaks.com/topic/56979-solved-mysql-syntax/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.