Hi,
Here is part of my code:
$query = "SELECT * FROM listings WHERE propertyID='$propertyID'";
$result = mysql_query($query) or die(mysql_error());
while ($row = mysql_fetch_array($result)) {
$address = $row['address'];
$city = $row['city'];
$zipcode = $row['zipcode'];
}
$requiredArray = array("address" => "Street", "city" => "City", "zipcode" => "Zipcode");
foreach($requiredArray as $key=>$items)
{
echo '<tr><th><label for="'.$key.'">'.$items.'</label></th><td><input type="text" size="30" value="" name="'.$key.'" autocomplete="off"></td></tr>';
}
I want the value in my form to equal to $address, $city, then $zipcode.
Essentially, I want to end up with this.
<tr><th><label for="'.$key.'">'.$items.'</label></th><td><input type="text" size="30" value="'.$address.'" name="'.$key.'" autocomplete="off"></td></tr>
<tr><th><label for="'.$key.'">'.$items.'</label></th><td><input type="text" size="30" value="'.$city.'" name="'.$key.'" autocomplete="off"></td></tr>
<tr><th><label for="'.$key.'">'.$items.'</label></th><td><input type="text" size="30" value="'.$zipcode.'" name="'.$key.'" autocomplete="off"></td></tr>
Thanks for any help you might provide. 🙂