Hi,
I am trying to repopulate an HTML form with data I pull from a database so the user can update and edit the information. However, the data is cut off at the first space, meaning if a string has 2 words, only the first word will be seen.
So for example, if I have "Super men" for my UnionName field, and try to populate a textbox with it, only "Super" will show up. ("Super men" will show up correctly if not in a text box though.)
Am I doing something wrong here? Much help appreciated, thanks greatly in advance.
here is my code
Edit Unions
<form action="editunion.php" method="post" name="edit">
<table border="1">
<tr>
<td></tD>
<td>Union Name</td>
<td>Union Location</td>
</tr>
<?php
include 'odbc.php';
$query = odbc_exec($odbc, "SELECT * FROM Unions") or die (odbc_errormsg());
$i = 0;
while($row = odbc_fetch_array($query))
{
echo "<tr>";
echo "<td><input type=checkbox name=" . "UnionKey[]" . " value=" . $row['UnionKey'] . "></td>";
echo "<td><input type=textbox name=" . "UnionName[]" . " value=" . (string)$row['UnionName'] . "></td> ";
echo "<td><input type=textbox name=" . "UnionLocation[]" . " value=" . (string)$row['UnionLocation'] . "></td>";
$i ++;
echo "</tr>";
}
odbc_close($odbc);
?>
</table>
<p><input type="submit" name="edit" value="Edit selected"></td>
</form>