Answer the question
In order to leave comments, you need to log in
PHP: how to insert array value in mysql SELECT statement?
Good afternoon!
into the given SELECT query
$query ="SELECT `id`, `name_prod`, `amount`, `summ`, (summ*amount) AS `summ2`, DATE_FORMAT(data_p, '%d.%m.%Y') `data_p`, `status`, `weight`, `metall` FROM $post_name WHERE id IN ($post_id)";
Answer the question
In order to leave comments, you need to log in
strings must be in quotes - incl.
and generally use mysqli/pdo objects "'" . implode("', '", $values) . "'"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question