title: php mysql + create profile page
body: <p>hey i am new here any one can help me with this chunk of code in php and mysql 
   i know that this is a little mistake but i could not know where is the error and thank you.
   this is the code :</p>
  
  <p>//index.php</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;Search for a user&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;h2&gt; Search for a user below:&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;
  &lt;form action="profileprocess.php" method="get"&gt;
    &lt;table&gt;
     &lt;tr&gt;
      &lt;td&gt;Username:&lt;/td&gt;&lt;td&gt;&lt;input type="text" id="username" name="username" /&gt;&lt;/td&gt;&lt;/tr&gt;
      &lt;tr&gt;
      &lt;td&gt;&lt;input type="submit" name="submit" id="submit"  value="View Profile" /&gt;&lt;/td&gt;
      &lt;/tr&gt;
  
  
    &lt;/table&gt;
  
  
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>// profileprocess.php</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;&lt;?php echo $username; ?&gt; &lt;?php echo $lastname; ?&gt;s profile&lt;/title&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
  &lt;?php
   if(isset($_GET['username'])){
  
      $username = $_GET['username']; 
      mysql_connect("localhost", "root", "") or die ("could not connect t the server");
      mysql_select_db("users") or die("this database was not found");
      $userquery = mysql_query("SELECT * FROM users WHERE username='$username'") or die("the query could be fale please try again");
      if(mysql_num_rows($userquery) != 1){
          die("that username could not be found!");
      }
      while($row = mysql_fetch_array($userquery, MYSQL_ASSOC)){
         $firstname = $row['firstname'];
         $lastname = $row['lastname'];
         $email = $row['email'];
         $dbusername = $row['username'];
         $activated = $row['activated'];
         $access = $row['access'];
         }
         if($username != $dbusername){
           die ("there has been a fatal error please try again. ");
         }
         if($activated == 0){
          $active = "this account has not been activated";
         }else{
            $active = "ths  account has been activated";
         }
  
         if($access == 0){
           $admin = "this user is not administrator";
         }else{
           $admin = "this user is  an administrator";
         }
  ?&gt;
  &lt;h2&gt;&lt;?php echo $username; ?&gt; &lt;?php echo $lastname; ?&gt;s profile&lt;/h2&gt;
  &lt;table&gt;
  &lt;tr&gt;
  &lt;td&gt;firstname:&lt;/td&gt;&lt;td&gt;&lt;?php echo $firstname; ?&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;lastname:&lt;/td&gt;&lt;td&gt;&lt;?php echo $lastname; ?&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;email:&lt;/td&gt;&lt;td&gt;&lt;?php echo $email; ?&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;username:&lt;/td&gt;&lt;td&gt;&lt;?php echo $dbusername; ?&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;activated:&lt;/td&gt;&lt;td&gt;&lt;?php echo $active; ?&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;access:&lt;/td&gt;&lt;td&gt;&lt;?php echo $admin; ?&gt;&lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;/table&gt;
  
  
  &lt;?php      
   }else die("You need  to specify a username!");
  
  
  ?&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>//// any help????</p>