title: PHP CRUD Unknown column in 'where clause'
body: <p>I am creating a CRUD page. I've been able to insert data into my database, with the following code:</p>
  
  <pre><code>    $query="INSERT INTO user(USER_ID, PASSWORD, FIRST_NAME, LAST_NAME, CONTACT_NO, SHIPPING_ADDRESS, BILLING_ADDRESS, EMAIL) VALUES('$user_id', '$password', '$first_name', '$last_name', '$contact_no', '$shipping_address', '$billing_address', '$email')";
  if(mysqli_query($con, $query))
  {
  echo "&lt;center&gt;&lt;font color=#FF0000&gt;Record Inserted!&lt;/font&gt;&lt;/center&gt;&lt;br&gt;";
  }
  else{printf("error: %s\n", mysqli_error($con));}
      }
  }
  </code></pre>
  
  <p>however, i am unable to delete nor edit the data as the "Unknown column in 'where clause' " error will appear. i've tried finding for solutions on google but they did not work. can someone help to see if there are any errors in my code?</p>
  
  <p>The following codes are for editting data in the database:</p>
  
  <pre><code>$query="UPDATE user SET USER_ID='$user_id' , PASSWORD='$password', FIRST_NAME='$first_name', LAST_NAME='$last_name', CONTACT_NO='$contact_no', SHIPPING_ADDRESS='$shipping_address', BILLING_ADDRESS='$billing_address', EMAIL='$email' WHERE USER_ID=".$_POST['user_id'];
  if(mysqli_query($con, $query))
  {
      echo "&lt;center&gt;&lt;font color=#FF0000&gt;Record Updated!&lt;/font&gt;&lt;/center&gt;&lt;br&gt;";
  }
  else{printf("error: %s\n", mysqli_error($con));}
  }
  </code></pre>
  
  <p>The following codes are for deleting data in the database:</p>
  
  <pre><code>    if(isset($_GET['operation'])){
      if($_GET['operation']=="delete")
      {
          $query="DELETE FROM user WHERE USER_ID=".$_GET['user_id'];  
          if(mysqli_query($con, $query))
          {
              echo "&lt;center&gt;&lt;font color=#FF0000&gt;Record Deleted!&lt;/font&gt;&lt;/center&gt;&lt;br&gt;";
          }
          else{printf("error: %s\n", mysqli_error($con));}
      }
  }
  </code></pre>