我试图运行此查询但它仍然失败。谁知道哪个部分出错?
$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));
}