mysql - SELECT WHERE IN query using text string -


i've had bit of around, , tried few things, can't seem work... can help?

$typeall = " ('house','condo','loft','townhouse','land')";  $rs = mysql_query("select * 'houses' , category in " .$typeall);  

does not work

but if type

$rs = mysql_query("select * 'houses' , category in ('house','condo','loft','townhouse','land')");  

it works perfect, why?

thanks.

try this:

$typeall = "'house','condo','loft','townhouse','land'";  $rs = mysql_query("select * 'houses' , category in (".$typeall.")"); 

may variable $typeall not working in brackets.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -