PHP MYSQL not all values displayed in HTML input value
Posted: Mon Jul 27, 2009 10:39 pm
Hello,
For some reason the code below will only display the first word of the DB column as the value. Any help is much appreciated.
For some reason the code below will only display the first word of the DB column as the value. Any help is much appreciated.
Code: Select all
$sql = "SELECT * FROM regions WHERE region_id=$id";
$regions = mysql_query($sql) or die(mysql_error());;
while($row = mysql_fetch_array($regions))
{
$id = $row['region_id'];
$region_name = $row['region_name'];
$start_postal = $row['start_postal'];
$end_postal = $row['end_postal'];
echo "<tr>";
echo "<th>ID</th><td>" . $id . "</td></tr>";
echo "<input type=hidden name=region_id value=$id>";
echo "<tr><th>Region Name</th><td><input type=text valign=center name=region_name value=" . $region_name . "></td></tr>";