I was doing CRUD operation in PHP code combined with HTML code using while. I want HTML code to repeat after every execution of while(). But it is giving error: "Parse error: syntax error, unexpected '?> ' in C:\xampp\htdocs\php\index1.php on line 21" . Anyone can solve this issue. I have mentioned the code below:
<?php
$con=mysqli_connect("localhost","root","","student");
$sql="select * from student_php";
$res=mysqli_query($con,$sql);
?>
<table>
<tr>
<td>S.No</td>
<td>Name</td>
<td>City</td>
</tr>
<?php
while($row =mysqli_fetch_assoc($res){
?>
<tr>
<td>S.No</td>
<td><?php echo $row['name']?></td>
<td><?php echo $row['city']?></td>
</tr>
<?php }
?>
</table>