<?php
$connect = mysqli_connect('localhost', 'root', ' ', ' ');
if(mysqli_connect_errno($connect)){
echo 'Failed to connecto to database'.mysqli_connect_error();}
$result= mysqli_query($connect, "SELECT * FROM Products WHERE ProductCategory = 'Electronics'");
?>
<table width="500", cellpadding=5 callspacing=5 border=1>
<tr>
<th>Product Name</th>
<th>Product Price</th>
<th>Product Image</th>
<th>Product Description</th>
<th>Product Category</th>
</tr>
<?php while($rows = mysqli_fetch_array($result)): ?>
<tr>
<td><?php echo $rows['ProductName']; ?></td>
<td><?php echo $rows['ProductPrice']; ?></td>
<td><?php echo '<p<img src="images/'.$row["ProductImage"].'" />'; ?></td>
<td><?php echo $rows['ProductDescription']; ?></td>
<td><?php echo $rows['ProductCategory']; ?></td>
</tr>
<?php endwhile; ?>
</table>
내 문제는 코드가 한 행씩 데이터베이스를 통과하여 정보를 얻지 만 이미지 행이 오면 이미지가 웹 페이지의 폴더 내에있는 이미지라는 폴더에 저장되면 아무 것도 검색하지 않고 내 디렉토리가 정확합니다.이미지가 표에서 표시되지 않음
내가 그 일을했지만 여전히 이미지를로드하는 것이 아니라, 지금은 깨진을 보여주는 것 이미지 링크. – hjg
나는 그것을 고쳤다. 행을 만들 때 줄을 놓치는 것은 정말 어리석은 실수였다. 도움을 주셔서 감사합니다. 이 이미지를 특정 크기로 만드는 방법이 있습니까? – hjg
예, CSS로 –