My insert into query fails if the data that i want to insert contains '
Here is the 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')";
i want to insert the value ' inside the address but it will output an error which is:
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