MySQL查询只返回联合中的第二个SELECT结果,我不知道为什么......你能帮助吗?
$query = "SELECT name ";
$query .= "FROM nutrients ";
$query .= "WHERE name LIKE '%{$sqlsafe_query}%' ";
$query .= "LIMIT 30 ";
$query .= "UNION ALL ";
$query = "SELECT name ";
$query .= "FROM supplements ";
$query .= "WHERE name LIKE '%{$sqlsafe_query}%' ";
$query .= "LIMIT 30";
答案 0 :(得分:1)
$query = "SELECT name ";
你是否缺乏。在=?
之前