我想问一些事,
<?php
require "connection.php";
$query = "SELECT * FROM main";
$sql=mysqli_query($con,$query);
$ray = array();
echo"<table>";
while($row=mysqli_fetch_array($sql)){
echo"<tr>";
$ray[]= array(
echo"<td>";?> 'gambar'=><img src="<?php $row["gambar"], ?>" height="100" width="100"><?php echo "</td>";
echo "<td>"; 'id' => $row["id"], echo "</td>";
echo "<td>"; 'nama'=>$row["nama"], echo "</td>";
echo "<td>"; 'harga'=>$row["harga"] echo "</td>";
echo "</tr>";
));}
echo "</table>";
echo json_encode($ray);
?>
这是我的php配置。我不知道 为什么结果看起来像这样
Parse error: syntax error, unexpected 'echo' (T_ECHO), expecting ')' in /home/u220924381/public_html/private_html/displaying.php on line 10
我是新手,这是我的校园项目。我尝试了很多方法,但它无法解决我的问题。