$artist_user_ids = implode(',',$artist_user_ids);
$referrer = "referrer IN (?)";
$query = "SELECT id FROM users WHERE $referrer";
$con = db_connect();
$stmt = db_prepare($con, $query);
bind_param('s', $artist_user_ids);
这不起作用。但是,如果我将第1行更改为:
$artist_user_ids = "'" . implode(',',$artist_user_ids) . "'";
它就像一个魅力。是什么给了什么?
答案 0 :(得分:0)
SELECT id FROM users WHERE referrer IN ('val1, val2, ...');
但它不太正确....你必须以其他方式做到