The task is pretty straight forward. Using an html form, a last name is posted into a php code which connects to myAdmin database and returns the first and last name associated with the form posted last name from the html search. I've double checked my database, as well as the connection php I am using. The information is in the db and my connection.php file has worked fine for other files accessing and manipulating this same db. Anyway here is my html code:
<html>
<body>
<form action="where.php" method="post">
Lastname: <input type="text" name="lastname" />
<input type="submit" name="search" />
</form>
</body>
</html>
and my post php code:
<?php
include('connection.php');
$sql = "SECLECT * FROM PERSONS WHERE LastName ='$_POST[lastname]'";
$result = mysql_query($sql);
?>
<table border='1'>
<tr>
<td>Firstname</td>
<td>Lastname</td>
</tr>
<?php
while($row = mysql_fetch_array($result))
{
?>
<tr>
<td><?php echo $row['FirstName'] ?></td>
<td><?php echo $row['LastName'] ?></td>
</tr>
<?php
}
?>
</table>
<?php
mysql_close($con);
?>
Anyone see why when I search for a valid last name I get back a table that only has the headings but no values?