db_query and single quote escape give sql error
It seems that using %s for db_query, single tick (') is escaped to \'. I think SQL says it should be '' for escaped single quote. At least that is what works with mysql. It works when do a replace manually wiht '' and then concatenate the strings.
db_query("INSERT INTO {term_data} (vid,name,description,weight) VALUES (%d,'%s','%s',%d)",
$vid,$new_gallery,$new_desc,1); <<< $new_gallery = "Aaron's New Gallery"
...
user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 query: SELECT t.tid from term_data t WHERE t.name='Tessa\'s apostrophe') in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\php\sites\all\modules\imgupload\imgupload.module on line 214.
