这是我显示多个表的语法,但没有信息。谁能告诉我哪里错了?
$sql = "SELECT 'i'.*,
't'.'name' AS 'type_name', 'c'.'name' AS 'client_name'
FROM 'items' 'i'
JOIN 'types' 't', 'clients' 'c'
ON 't'.'id' = 'i'.'type', 'c'.'id' = 'i'.'client'
ORDER BY 'i'.'date' DESC";
$result = $objDb->query($sql);
if (!$result) {
throw new PDOException("Error Processing Request");
}
$result->setFetchMode(PDO::FETCH_ASSOC);
$items = $result->fetchAll();
$sql = "SELECT 'clients', 'types'
FROM 'items', 'clients'
ORDER BY 'id'";
$result = $objDb->query($sql);
if (!$result) {
throw new PDOException("Error Processing Request");
}