Jump to content

using quotations within text in a database


rbastien

Recommended Posts

Hey,

 

I have a textarea that sends the text to the database.

<textarea name="example" method="post" />

 

The problem is that if the text contains anything that will obstruct the php coding (such as a quotation mark, a semicolon, bracket, etc...) it processes it, and results in a MYSQL error. The database row is set to VARCHAR NOT NULL.

 

@extract($_REQUEST);
mySqlconnect(); 
mysql_query("INSERT INTO table(id, artist, song) VALUES ('5', '$artistname', '$songname')");

 

It works perfectly without using any characters that will interrupt the code. Will i have to insert a backslash every time I use a special character, or is there an easier way?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.