Hi guys, I have a form set up to insert data into a table in MySQL database. In the text field, everything inserts to the table just fine as long as the user doesn't enter a contraction into the test field (It's, I've, etc.). If the user does enter a contraction into their response, none of the information from the form makes it to the database table. Anyone know what's going on here?
If the user enters an apostrophe, that ends the data for the field. You have to clean the user-entered data before inserting it. (What you're doing leaves you open to a SQL Injection attack.) Either use str_replace() to replace ' with '' (2 single quotes), or use mysqli_real_escape_string() to clean the string up.