title: Using a PHP variable as a form fields default value
body: <p>I have a created an HTML form where users sign up and input there data into an SQL database. I have then retrieved that data in a webpage where they can view their profile. I have created a page where users can edit there profile by creating a form which updates the value in the SQL database for there user id.</p>
  
  <p>I would like the form to use the current value of the SQL cell as the default for that user to make alterations easier. Example: currently user 7 has their city set as New York, when they visits the edit info page, the city field in the form already hase New York as the default value. </p>
  
  <p>I have no problem getting the SQL info and assigning it to a variable, I just don't understand how to set it as the default value. I am aware of how you set default values for input fields though.</p>
  
  <p>My code:</p>
  
  <pre><code>&lt;?php
  $id = $_SESSION["user_id"];    
  
  // Create a query for the database
  $query = "SELECT full_name FROM users WHERE id = $id LIMIT 1";
  
  // Get a response from the database by sending the connection
  // and the query
  $response = @mysqli_query($dbc, $query);
  
  // If the query executed properly proceed
  if($response){
  while($row = mysqli_fetch_array($response)){
  echo $row['full_name'];   
  echo mysqli_error();    
  }
  }
  ?&gt;  
  &lt;input type="text" name="aboutme" defualt="&lt;?php echo $row['aboutme'] ?&gt;" &gt;  
  </code></pre>