SQL Query无法使用限制

时间:2017-10-17 16:49:54

标签: php sql

我试图运行此查询但它仍然失败。谁知道哪个部分出错?

$query = "Select * FROM trade WHERE category = :categoryID order by id DESC limit :startID, 5";

$query_params = array(
    ':categoryID' => $_POST['categoryID'],
    ':startID' => $_POST['startID']
);


//execute query
try {
    $stmt   = $db->prepare($query);
    $result = $stmt->execute($query_params);
}
catch (PDOException $ex) {
    $response["success"] = 0;
    $response["message"] = "Database Error!";
    die(json_encode($response));
}

0 个答案:

没有答案