Code:
<?php
require('includes/header.php');
?>
<?php
$sql = "SELECT customers.Country, customers.CompanyName, customers.ContactName, customers.Address, customers.City, customers.PostalCode, customers.Phone
FROM customers
WHERE customers.Country = '" . $_GET['country'] . "%';";
$result = mysql_query($sql) or die(mysql_error());
echo "<table border='1'>
<tr>
<th>Company Name</th>
<th>Contact</th>
<th>Address</th>
<th>City</th>
<th>Postal Code</th>
<th>Phone Number</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['CompanyName'] . "</td>";
echo "<td>" . $row['ContactName'] . "</td>";
echo "<td>" . $row['Address'] . "</td>";
echo "<td>" . $row['City'] . "</td>";
echo "<td>" . $row['PostalCode'] . "</td>";
echo "<td>" . $row['Phone'] . "</td>";
}
echo "</table>";
?>
<?php
require('includes/footer.php');
?>
The table is blank,except for the column names, but the query runs fine in phpMyAdmin. What am I doing wrong?