Good day everyone.
Please help me. I am trying to echo a php row in a value attribute. But for some reason, I am getting an error.
Here is the code. Thanks a lot.
<?php
$sql = "SELECT * FROM customer";
$result = $conn-> query($sql);
if ($result-> num_rows > 0) {
while ($row = $result-> fetch_assoc()) {
echo "<tbody id='searchresult'>
<tr>
<form action='' method='POST'>
<td>
<input type='checkbox' name='deleteId[]' value=' <?php echo $row['id'] ?> ' />
</td>
</form>
<td>". $row["surname"] . "</td>
<td>". $row["firstname"] . "</td>
<td>". $row["mobilenumber"] . "</td>
<td>". $row["defect"] . "</td>
<td>". $row["date_added"] . "</td>
</tr>
</tbody>" ;
}
echo "</table>";
}
?>
I tried asking chatgpt if the input line was wrong but the answer it gave me didn’t yield anything.
I expect no errors
New contributor
Joshua Abioye is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.