I am trying to use some PHP to access a database I created and load it into text boxes. Currently, the code below loads a list of text boxes and populates the 'name' field, but loads empty text boxes for all the other sections.
I have made sure that the $row['query'] parameters are correct.
Here is what I am seeing:
$sql = "SELECT * from salesmen";
$stmt = $conn->query($sql);
echo '<table border="0">';
echo '<tr>
<td align="center">Name</td>
<td align="center">User ID</td>
<td align="center">Password</td>
<td align="center">Commission</td>
<td align="center">Address</td>
</tr>';
while($row = $stmt->fetch(PDO::FETCH_ASSOC))
{
echo '<tr>';
echo '<td><input type="text" name="name" value="' .$row['name']. '"></td>';
echo '<td><input type="text" name="id" value"' .$row['id']. '"></td>';
echo '<td><input type="text" name="password" value"' .$row['password']. '"></td>';
echo '<td><input type="text" naem="commission" value"' .$row['commission']. '"></td>';
echo '<td><input type="text" name="address" value"' .$row['address']. '"></td>';
echo '</tr>';
}
echo '</table>'
<?php error_reporting(E_ALL); ini_set('display_errors', 1);
then the rest of your code. It would have caught those parse errors. Including the one forecho '</table>'
which I edited both answers for. Least, for what you posted. I take posted code literally ;-)echo '</table>'
a bad paste and you didn't put in the missing semi-colon? there's a suggested pending edit in your OP about it to add it.