如何我可以PDO
顯示錯誤與這個特定的準備和執行:PHP PDO顯示錯誤準備執行
try
{
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$stmt = $pdo->prepare("SELECT ZZZZZZ, nomepostazimiele FROM postazimiele");
$stmt->execute();
while ($row_postazimiele = $stmt->fetch(PDO::FETCH_ASSOC))
{
$idnomepostazi = $row_postazimiele['idpostazi'];
$nomepostazimiele = $row_postazimiele['nomepostazimiele'];
echo "<option value=\"$nomepostazimiele\">$nomepostazimiele</option>";
}
}
catch (pdoException $e)
{
echo 'Attenzione: ' . $e->getMessage();
$output = "Impossibile collegarsi al Data Base, Utente o Password errati"
. "<br>" . "<br>" . "prego riprovare" . $e
. "<br>" . "<br>" . "<a href='miele.php'>Clicca QUI per ritornare alla pagina principale</a>";
include 'errore.html.php';
exit();
}
如果我做出錯誤的SELECT
想起來似乎沒有錯誤。爲什麼?
有人能幫助我嗎?
你有什麼錯誤? – 2014-09-24 12:30:16
是否連接到數據庫? – 2014-09-24 12:31:19
我連接到分貝..... – user2024752 2015-09-01 13:29:46