Imploding an array (MySQL query)
MySQL query selects data from the whole column instead of just a part of
it (according to dropdown select sorting). I'm guessing it's due to the
implode function. Is there a way to solve it? Maybe imploding after MySQL
query would work? Any advices appreciated.
$weights = $_POST['pal_numb'];
//var_dump($weights).'br';
//array(1) { [0]=> string(1) "2" }
$weights = "'".implode("','",$_POST['pal_numb'])."'";
$result = mysql_query("SELECT * FROM pl_table WHERE pal_numb
in(".$weights.");");
//var_dump($weights).'br';
//array(1) { [0]=> string(1) "2" } string(3) "'2'"
No comments:
Post a Comment