0
Does anyone know how to get multiple elements from a database using an array that contains all the search id?? PHP/Mysql
static function list($ids){
$wa = "";
foreach ($ids as $key => $value) {
$wa .= " e_produto.id = {$value} OR";
}
$wa = substr($wa,0,-2);
$wa = ($wa!="")?"OR $wa":"";
////------------
$myid = User::id();
$query = "SELECT * FROM tabela WHERE $wa;";
$retorno = DB::dbQuery($query,$carrinhoArr);
return $retorno;
}
It’s the provisioning solution I got. But there is a "more correct way"?
You could give an example of mysql code?
– Edward Ramos