SQLSTATE [42000]:语法错误或访问冲突:1064

时间:2016-02-22 16:42:14

标签: php mysql

$sql = "SELECT mill GROUP_CONCAT(quantity ORDER BY  quantity ASC SEPARATOR "+") FROM  stock_avail WHERE quantity > 0 GROUP BY  mill AND "
        . " (mill LIKE :keyword) ORDER BY mill ";
$stmt = $DB->prepare($sql);

$stmt->bindValue(":keyword", $keyword."%");

} else {
$sql = "SELECT mil GROUP_CONCAT(quantity ORDER BY  quantity ASC SEPARATOR "+") FROM  stock_avail WHERE quantity > 0 GROUP BY  mill ";
$stmt = $DB->prepare($sql);
}

0 个答案:

没有答案