title: query for insert into fail if the value contain '
body: <p>My insert into query fails if the data that i want to insert contains '</p>
  
  <p>Here is the code:</p>
  
  <pre><code>$sql= "INSERT INTO user (username,password,first_name,Age,race,gender,address,father_name,hpfather_no,father_occupation,father_identitycard,mother_name,hpmother_no,mother_occupation,mother_identitycard,session,batch_id,user_type,user_id) values ('$username','$password','$first_name','$Age','$race','$gender','$address','$father_name','$hpfather_no','$father_occupation','$father_identitycard','$mother_name','$hpmother_no','$mother_occupation','$mother_identitycard','$Session','$batch_id','user','$user_id')";
  </code></pre>
  
  <p>i want to insert the value ' inside the address but it will output an error which is:</p>
  
  <p>You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near</p>