I am trying to create a table where a user selects a last name from an sql query drop-down-box (Select tag with options) that is also an sql query. I can get the combo box to work fine, but I cant get the other results to populate at all.
My code:
<table style = 'position: relative;' frame='box'>
<caption>Customer Information</caption>
<tr><td>Last Name</td><td>
<select name='Customer'>
<?php
$mysqli = new mysqli("mysql", "USER", "PASSWORD", "DBASE");
$query= $mysqli->query("SELECT DISTINCT * FROM Customer");
while ($row = mysqli_fetch_array($query)) {
echo "<option value='" . $row['LastName'] . "'>" .$row['LastName'] . "</option>";
}
?>
</select>
</td><td width="50"></td><td>City</td><td> </td></tr>
<tr><td>First Name</td><td>
<?php
$mysqli = new mysqli("mysql", "USER", "PASSWORD", "DBASE");
$query = $mysquli->query("SELECT * FROM Customer WHERE LastName = 'Customer'");
while ($result = mysqli_fetch_array($query)) {
echo "<td>'" . $result['FirstName'] . " ' " .$result['FirstName'] . "</td>";
}
?>
</td><td></td><td>State</td><td> </td></tr>
<tr><td>Company Name</td><td></td><td></td><td>Zip</td><td> </td></tr>
<tr><td>Address</td><td> </td><td></td><td>Phone</td><td> </td></tr>
<tr><td>Email</td><td> </td></tr>
</table>
This will also cut off everything after the First Name