如果你想让它的 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");