Jump to content

Format HTML for MySQL insert?


joecooper

Recommended Posts

Hi,

 

I have got a working HTMLarea input form. And using a form, it will input the data from the HTMLarea into a mysql database table.

 

But, the formatting breaks the MySQL query. How can I parse the information so this wouldnt happen?

 

The exact error is:

1064 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 '

content
in:
[iNSERT into zen_blog (id, content, active) VALUES ('',

content
, )!]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

Link to comment
https://forums.phpfreaks.com/topic/261182-format-html-for-mysql-insert/
Share on other sites

Yes we need to see the actual code.  It looks like your query starts out:

INSERT into zen_blog (id, content, active) VALUES ('',content,

 

Assuming "content" is a variable then you're missing the '$', if not, then you need quotes around it.

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.