in typical PHP applications I used to use mysql_real_escape_string before I did SQL inserts. However I am unable to do that in Drupal so would need some assistance. And without any sort of function like that, user input with apostrophes is breaking my code.
Please suggest.
Thank You
My SQL is as follows:
$sql = "INSERT INTO some_table (field1, field2) VALUES ('$field1', '$field2')";
db_query($sql);