我有以下查询:
$sql_select_todo =
"SELECT * FROM
to_do_items
WHERE
id_project = ".$_SESSION['selected_projectId']."'
AND
id IN ('".$alleTaken."')";
$query_select_todo = mysql_query($sql_select_todo) or die(mysql_error());
while($fetch_todo = mysql_fetch_assoc($query_select_todo)) {
echo $fetch_todo['name'];
}
当我回显查询时,我得到了这个:
SELECT * FROM to_do_items WHERE id_project = '7401' AND id IN ('10193,12848')
但是输出只会返回一个名字($fetch_todo['name'])
但是有 2 个 id,所以我应该得到 2 个名字。我在这里做错了什么?