Hello again codes masters,
I’m stuck at this piece of codes for dropdown menu. Here is the codes
echo '<h3>Select Supplier</h3>';
$deliver_sql = mysql_query("SELECT supplier_name FROM delivery") or die(mysql_error());
echo '<div align="left">';
echo '<form class="forms" action="returns.php" method="post" name="companyform">';
echo "<select class=\"input\" name=\"companyNames\" onChange=\"this.form.submit()\">";
while($row = mysql_fetch_array($deliver_sql) or die(mysql_error()))
{
echo '<option value="'.$row['supplier_name'].'">'.$row['supplier_name'].'</option>';
}
break;
echo '</select>';
echo '</form>';
echo '</div>';
My question is, Is there something wrong with this code? Because when I open this particular page, the footer aint displaying.
Its like there is something that is breaking the whole html codes that causes the footer to doesnt display, even if I used $_POST['companyform'] cannot also detected.
Can someone please find what causes this error.
The problem is in this line
when there are no more rows in the $deliver_sql, mysql_fetch_array will return false and die(mysql_error()) will be executed. mysql_fetch_array returning false is not an error so you should not call die in this case
Just use