By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,982 Members | 1,955 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,982 IT Pros & Developers. It's quick & easy.

IN clause in php mysql

P: 1
I need to retrieve all rows which suits a set of values in an array. Now am using
$bound = implode(",",$arr);


$sqls="SELECT * FROM main where area IN ( $bound )";
Oct 19 '11 #1
Share this Question
Share on Google+
1 Reply


Rabbit
Expert Mod 10K+
P: 12,349
That'll work if you're only using numeric data types. If it's a string, you need to surround each value in single quotes.
Oct 19 '11 #2

Post your reply

Sign in to post your reply or Sign up for a free account.