title: PHP retrieve data from table row and store to variable
body: <p>i guess the questions says it all. The result of my query results into a row which will match the condition. I want to get each data from each table column and put into a variable.</p>
  
  <pre><code>$getinfo = "select 
                     user_firstname, 
                     user_middlename, 
                     user_lastname 
                from tempuserinfo 
               where user_email ='$ead' 
                 and activation_code='$eac'";
  
  $query = mysql_query($getinfo, $db);
  if(!$query) {
      echo'something went wrong.';
  } else {
      //put them into variables
      $firstname = mysql_fetch_object($query, 'user_firstname');
      $middlename = mysql_fetch_object($query, 'user_middlename');
      $lastname = mysql_fetch_object($query, 'user_lastname');
  }
  </code></pre>