title: PHP Database Entry Issue (Wampserver)
body: <p>I'm a complete code nooby and months ago built a basic website before my server mobo died. I just rebuilt the server and copied over all my website/db code I had backed up to my desktop. To the best of my knowledge everything is the same between php code and database setup.</p>
  
  <p>My site works 90% except for when I go to input data. I get an error of "waiting for entry" opposed to the expected "New record created successfully". The relative if statement is <strong>on the very bottom</strong> of the below code.</p>
  
  <p>Does anyone by chance have any clue why after inputting all my proper data that it does not trigger the "New record created successfully"? If it means anything the code works fine on my desktop and unless I did something really dumb I copy/pasta'd everything appropriately to this server :(</p>
  
  <pre><code>&lt;?php
  
   //Connect to database
  
  include('database.php');
  
     //grab user logged in for database insertion
  
     $user_check = $_SESSION['login_user'];
  
     $ses_sql = mysqli_query($dbcon,"select username from t_login where username = '$user_check' ");
  
     $row = mysqli_fetch_array($ses_sql,MYSQLI_ASSOC);
  
     $login_session = $row['username'];
  
   // Create DB Variable
  
   $login_session = $row['username'];
   $excercisename = (isset($_POST['excercisename']) ? $_POST['excercisename'] : null);
   $setcount = (isset($_POST['setcount']) ? $_POST['setcount'] : null);
   $rep1 = (isset($_POST['rep1']) ? $_POST['rep1'] : null);
   $rep2 = (isset($_POST['rep2']) ? $_POST['rep2'] : null);
   $rep3 = (isset($_POST['rep3']) ? $_POST['rep3'] : null);
   $rep4 = (isset($_POST['rep4']) ? $_POST['rep4'] : null);
   $rep5 = (isset($_POST['rep5']) ? $_POST['rep5'] : null);
   $rep6 = (isset($_POST['rep6']) ? $_POST['rep6'] : null);
   $rep7 = (isset($_POST['rep7']) ? $_POST['rep7'] : null);
   $rep8 = (isset($_POST['rep8']) ? $_POST['rep8'] : null);
   $weight1 = (isset($_POST['number1']) ? $_POST['number1'] : null);
   $weight2 = (isset($_POST['number2']) ? $_POST['number2'] : null);
   $weight3 = (isset($_POST['number3']) ? $_POST['number3'] : null);
   $weight4 = (isset($_POST['number4']) ? $_POST['number4'] : null);
   $weight5 = (isset($_POST['number5']) ? $_POST['number5'] : null);
   $weight6 = (isset($_POST['number6']) ? $_POST['number6'] : null);
   $weight7 = (isset($_POST['number7']) ? $_POST['number7'] : null);
   $weight8 = (isset($_POST['number8']) ? $_POST['number8'] : null);
   $cardio = (isset($_POST['cardio']) ? $_POST['cardio'] : null);
   $duration = (isset($_POST['duration']) ? $_POST['duration'] : null);
   $weight = (isset($_POST['weight']) ? $_POST['weight'] : null);
   $comments = (isset($_POST['comments']) ? $_POST['comments'] : null);
  
  
   //Execute the insert statement
   if(!empty($excercisename)){
   $sql = "INSERT INTO t_workout (username, excercisename, setcount, set1reps, set2reps, set3reps, set4reps, set5reps, set6reps, set7reps, set8reps, set1weight, set2weight, set3weight, set4weight, set5weight, set6weight, set7weight, set8weight, cardio, cardio_dur, weight, comments) 
   VALUES ('$login_session', '$excercisename', '$setcount', '$rep1', '$rep2', '$rep3', '$rep4', '$rep5', '$rep6', '$rep7', '$rep8', '$weight1', '$weight2', '$weight3', '$weight4', '$weight5', '$weight6', '$weight7', '$weight8', '$cardio', '$duration', '$weight', '$comments')";
   }
  
    if($weight &gt; 0){
       $sql = "INSERT INTO t_workout (username, weight)
       VALUES ('$login_session', '$weight')";
    }
  
  if(isset($sql)){
      if ($dbcon-&gt;query($sql) === TRUE) {
      echo "New record created successfully";
  } else {
      echo "Waiting for entry.";
  }
  }
  $dbcon-&gt;close();
  ?&gt;
  </code></pre>