I'm having an issue with PHP inserting what seems to be randomly blank entries into a MySQL table. I'm a n00b developer and I'm sure this is a simple issue, but just can't seem to figure it out, and searching here and Google hasn't turned up a solution. Here's the code I'm working with:
Any help would be appreciated.
Code:
$search_name = $_POST['name'];
$enter_number = $_POST['number'];
$enter_city = $_POST['city'];
$enter_address = $_POST['address'];
mysql_query("INSERT INTO remote_sites (number, city, address)
VALUES('$enter_number','$enter_city','$enter_address')")
or die (mysql_error());
$result = mysql_query("SELECT * FROM remote_sites WHERE
city = '$search_name' ORDER BY number")
or die (mysql_error());
echo "<table border='8'>";
echo "<tr> <th>Number</th> <th>City</th> <th>Address</th></tr>";
while($display = mysql_fetch_array($result)) {
echo "<tr><td>";
echo $display['number'];
echo "</td><td>";
echo $display['city'];
echo "</td><td>";
echo $display['address'];
echo "</td></tr>";
}
echo "</table>";
Any help would be appreciated.