如果你想它的HTML輸出格式正確,那麼你可以檢查此:
echo "<tr>\n";
echo " <td>" . $row[0] . "<br />\n";
echo " " . $row[1] . "<br />\n";
echo " " . $row[2] . "<br />\n";
echo ' <img src="images/' . $row["skuCode"] . '_1.jpg"><br />' . "\n";
echo ' <a href="viewProductItem.php?skuCode=' . $row[0] . '">View</a></td><br />' . "\n";
echo "</tr>\n";
或者這個:
echo "<tr>\n";
echo " <td>" . $row[0] . "<br />\n";
echo " " . $row[1] . "<br />\n";
echo " " . $row[2] . "<br />\n";
echo " <img src=images/" . $row["skuCode"] . "_1.jpg><br />\n";
echo " <a href=viewProductItem.php?skuCode=" . $row[0] . ">View</a></td><br />\n"
echo "</tr>\n";
或者,如果你不喜歡這些,看看這個:
echo("<tr><td>" . $row[0] . "\n" .
"<br />\n" .
$row[1] . "\n" .
"<br />" . $row[2] . "\n" .
"<br />\n" .
"<img src=images/" . $row["skuCode"] . "_1.jpg>\n" .
"<br />\n" .
"<a href=viewProductItem.php?skuCode=" . $row[0] . ">View</a>\n" .
"</td></tr>\n");
你忘了周圍的'
單曲 – alfasin 2013-04-08 03:06:23
引號不打印多行文本類的。要麼脫離PHP模式,要麼至少使用[HEREDOC](http://php.net/heredoc)。那麼你就不會遇到忘記報價或者不得不逃避報價的問題。 – 2013-04-08 03:49:54