希望有人可以給我一些幫助...我使用PDO從數據庫中獲取一些數據,但每次腳本運行時都會返回並且沒有錯誤,但不會顯示所需的數據,我知道我正在尋找的數據也在那裏..任何幫助將不勝感激,這是我目前的,謝謝。PDO選擇語句
$db = new PDO('sqlite:C:\\xampp\\htdocs\\Utils\\PDF_Utils\\PDF2Word\\details.sqlite');
echo "<table border=1>";
echo "<tr><td>FileID</td>
<td>File Name</td>
<td>Email From</td>
<td>CC</td> <td>Subject</td>
<td>File Size</td></tr>";
$contents = $db->prepare("SELECT * FROM details WHERE fileName =
'$yourFileName'");
$contents->execute();
foreach($contents as $row) {
echo "<tr><td>" . $row['FileID'] . "</td>";
echo "<td>" . $row['fileName'] . "</td>";
echo "<td>" . $row['emailFrom'] . "</td>";
echo "<td>" . $row['CC'] . "</td>";
echo "<td>" . $row['subject'] . "</td>";
echo "<td>" . $row['fileSize'] . "</td></tr>";
}
echo "</table>";
應該是'array($ yourFileName)' – hjpotter92 2013-05-13 10:27:27
@ hjpotter92錯過了。固定。 – Ander2 2013-05-13 10:29:17
試過了,它仍然只是顯示一張空白表... – 2013-05-13 10:34:11