I'm trying to populate a form as such:
$email = $_SESSION["email"];
$result = $mysqli->query("SELECT * FROM patient WHERE email = '$email'");
$user = $result->fetch_assoc();
$firstName = $user["firstName"];
$lastName = $user["lastName"];
$bday = $user["bday"];
$address1 = $user["address1"];
$address2 = $user["address2"];
$city = $user["city"];
$state = $user["state"];
$zipCode = $user["zipCode"];
$phone = $user["mobilePhone"];
$contactMethod = $user["contactMethod"];
$reminders = $user["reminders"];
$updates = $user["updates"];
I'm then using echo like this:
<input type="text" name="address1" <?php echo 'value=' . $address1; ?> required />
It works for every field except the one shown. It only gets the first word of the column. For example, "123 First Street" only populates the input field as "123". If I delete the space and set the column value to "123FirstStreet" the whole thing populates. So I'm guessing that mySQL is automatically using a space delimiter to separate values within a column. Is there a way to fetch entire column? Thanks in advance.