title: Unable to INSERT any records in MYSQL from PHP
body: <p>So I am trying to develop an app and I need an API, so I am trying now PHP in order to pass my variables from the app to the MYSQL. I am trying with $_GET first in order to see if everything works fine. I tried to pass variables to the database through MYSQL Workbench and then from the app and worked fine. But, when I emptied the table and tried again it didn't work! So I am guessing that my loop doesn't respond well to the fact that my table is empty(?)</p>
  
  <p>This is the code that checks for the email and username if exists and if not insert the variables:</p>
  
  <pre><code>$result = 'notSet';
  
  
  $query=mysql_query("SELECT * FROM project");
  
  while ($row = mysql_fetch_assoc($query)) {
       if(strcmp($row['email'],$email)==0){ //strcmp uses two strings and it returns an integer, if 0 then no differences if more than 0 then there are
          $result = 'Email exists';
      }else{
          if(strcmp($row['username'],$username)==0){
          $result = 'Username exists';
      }else{          
          //encryption
          $insert = mysql_query("INSERT INTO project VALUES ('$userid', '$fullname','$username','$password','$course','$year','$age','$email')");
          $result = 'Registered';
          session_start();
          $session = session_id();
          $SESSION['username']=$username;
      }
  }
  }
  </code></pre>
  
  <p>Any ideas??</p>