var comma = ",";
var querys = "insert into movie values ("
+ "'" + movid + "'"
+comma
+ "'" + name + "'"
+ comma
+ "'" + genere + "'"
+ comma
+ "'" + director + "'"
+ comma
+ "'" + description + "'"
+ ")";
I've encountered an issue with the above code. I'm currently working on a website using express.js and mysql, allowing users to submit new movies.
The problem arises when the user inputs descriptions that contain single quotes (example: This movie wasn't shot in studio), resulting in an error. I've attempted using the comma variable and the escape character "'", but it doesn't solve the issue.
Is there a solution for this? I can't rely on users to manually escape single quotes with a backslash as many of them may not be familiar with this method.