I have a php file where it has a table with check box with the value which is equal to the ID from MYSQL table. When I run it I get the error.
I know there is some problem with ” and ‘ can any one help in solving this?
while ($row = mysqli_fetch_array($result))
{
echo "<tr>";
***//I get error in the following line***
echo"<td> <form action="del_prod.php" method="post">input type="checkbox" name="product_id" value="$row["product_id"]"></td>"
echo "<td>" . $row['product_id'] . "</td>";
echo "<td >" . $row['product_name'] . "</td>";
echo "<td>" . $row['weight'] . "</td>";
echo "</tr>";
}
echo "</table>";
?>
You have several problems with your line.
This is all aside from the fact that the form tag shouldn’t really be in the
<td>. It should be outside of the table, or better yet without a table at all! 🙂