我试图在我的表格中显示通过PHP代码显示的图像,但是它给了我一个错误,我无法弄清楚在哪里。
echo '<tr><td align="left" valign="top" class="description"> . "<img src='images/" . $product_data["mainImageThumbnail"] . "' alt='Product image' />
<p><a href="main.php?prodid=' . $product["product_id"] . '">' . $product["name"] . '</a>
<br /> $products_data["description"] </p>
<a href="#">Remove</a>
</td> ';
答案 0 :(得分:1)
问题在于PHP与HTML的连接
echo '<tr><td align="left" valign="top" class="description">
<img src="images/' . $product_data["mainImageThumbnail"] . '" alt="Product image" />
<p><a href="main.php?prodid=' . $product["product_id"] . '">' . $product["name"] . '</a>
<br />'. $products_data["description"] .'</p>
<a href="#">Remove</a>
</td> ';
答案 1 :(得分:1)
echo '<tr>
<td align="left" valign="top" class="description">
<img src="images/' . $product_data["mainImageThumbnail"] . '" alt="Product image"/>
<p>
<a href="main.php?prodid=' . $product["product_id"] . '">' . $product["name"] . '</a>
<br/>' .
$products_data["description"] . '
</p>
<a href="#">Remove</a>
</td> ';