ElDonAntonio
Senior member
Hi guys,
I don't know much about PHP and MySQL, but a guy did a job for me and I found a bug I need to eliminate myself.
Here it is basically:
The page allows you to put books on sale on the site. So I have a form with some text fields and a submit button.
I have a text field with the name of a book for example:
"Algebra, student's textbook"
Problem is, as soon there's an apostrophe (this character -> '), an error occurs when you click on submit. Instead of inserting the info in the database, the following output occurs:
INSERT INTO livre (SchoolID, Name, Author, Year, Edition, Price) VALUES ('92', 'Flight 314, student's logbook, cahier', '', '0', 'Lidec', '0', '23')
Of course, that's because there's a confusion between the closing apostrophe and the apostrphe in "student's".
So in my form, how do I convert the apostrophe entered in the textfield to something acceptable before it is submitted and sent to the database?
I don't know much about PHP and MySQL, but a guy did a job for me and I found a bug I need to eliminate myself.
Here it is basically:
The page allows you to put books on sale on the site. So I have a form with some text fields and a submit button.
I have a text field with the name of a book for example:
"Algebra, student's textbook"
Problem is, as soon there's an apostrophe (this character -> '), an error occurs when you click on submit. Instead of inserting the info in the database, the following output occurs:
INSERT INTO livre (SchoolID, Name, Author, Year, Edition, Price) VALUES ('92', 'Flight 314, student's logbook, cahier', '', '0', 'Lidec', '0', '23')
Of course, that's because there's a confusion between the closing apostrophe and the apostrphe in "student's".
So in my form, how do I convert the apostrophe entered in the textfield to something acceptable before it is submitted and sent to the database?