title: Query was empty PHP error
body: <p>I am trying to build a cart using MySQL. I keep getting this error 'Query was empty' when I run this code. Please help I've tried several things such as putting the variables inside the string instead of concatenating it.</p>
  
  <pre><code>&lt;?php ob_start(); ?&gt;&lt;?php require_once("../include/membersite_config.php"); ?&gt;
  &lt;?php 
      require('../products_reloaded/config.php');
      session_start();
  
              $user = $_REQUEST['user'];
              $user = mysql_real_escape_string($user);
              $itemNum = $_REQUEST['itemNum'];
              $itemNum = mysql_real_escape_string($itemNum);
              $quantity = $_POST['quantity'];
              $quantity = intval($quantity);
              $CheckForExistence = mysql_query("select * from cart where user = '$user' and p_number = '$itemNum'" );
              $alreadyExistsChecker = mysql_num_rows($CheckForExistence);
              if($alreadyExistsChecker &gt;= 1)
              {
                  $quantity +=1;
                  echo "this is equal to $alreadyExistsChecker";
              }
  
              if($alreadyExistsChecker == 0)
              {
                  $getQuery = mysql_query("select * from product where p_number = '$itemNum'");
  
  
                  while($row = mysql_fetch_array($getQuery))
                  {
                      $name = $row['p_name'];
                      $image = $row['p_url'];
                      $price = $row['p_price'];
                  }
                  $name = mysql_real_escape_string($name);
                  $image = mysql_real_escape_string($image);
                  $price = intval($price);
                  $query = mysql_query('insert into cart values('.$user.','.$itemNum.','.$name.', '.$image.','.$quantity.', '.$price.')'); 
                  $result = mysql_query($query);
                  if (!$result) {
                      print "An error occured: " . mysql_error() . "\n";
                  }
  
              }
  
              header('http://www.definitionxjm.com/shopping/viewCart.php');
  
  
  
  ?&gt;
  </code></pre>