<?php
if (mysqli_num_rows($result) > 0 ){
while($row = mysqli_fetch_assoc($result)){
$fName = $row['firstName'];
$sName = $row["lastName"];
$email = $row["email"];
$address1 = $row['address1'];
$address2 = $row["address2"];
$address3 = $row["address3"];
$city = $row["city"];
$county = $row["county"];
$postcode = $row["postcode"];
$country = $row["country"];
$mobile = $row["mobile"];
$homeNum = $row["home"];
}
}
?>
<?php
<label for="subject">Address 1:</label>
<input type="text" id="lname" name="address1" size ="40" value=<?php echo $address1 ?>> <br>
I want the form to have the value "address1" that is in the db. It is meant to echo out "27 Lisburn Road" from the db row "address1" in the form value, however, only "27" appears in the form on the webpage.
When I echo out $address1 not in the form, the full address is outputted on the webpage(i.e - 27 Lisburn Road).
So in conclusion, I am very confused because when I echo $address1 as the form value, only "27" is outputted on the webpage, but outside the form "27 Lisburn Road" is outputted when $address1 is echoed.
Anyone know how I can solve this?
Thanks!
Aucun commentaire:
Enregistrer un commentaire