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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.