Reputation: 265
I am performing a search of my sql database, and assigning the data from each row to a variable. Ex.
$query = mysql_query("SELECT * FROM `PropertyInfo` WHERE `sitestreet` LIKE '$street'");
// display query results
while($row = mysql_fetch_array($query))
{
$sitestreet = $row['sitestreet'];
$sitestate =$row['sitestate'];
}
Now my question is how do I get that info to display as text in a text box?
Thanks!
Upvotes: 1
Views: 36501
Reputation: 5695
You can fetch and assign in some time:
while($row = mysql_fetch_array($query))
{
echo "<input type='text' id='sitestreet' value='$row['sitestreet']' /><br />
<input type='text' id='sitestate' value='$row['sitestate']' />";
}
Upvotes: 0
Reputation: 56769
By echoing a textbox with those variables in the value=""
attribute
echo "<input type='text' id='sitestreet' value='$sitestreet' />"
echo "<input type='text' id='sitestate' value='$sitestate' />"
Upvotes: 2