Jump to content

Shell PHP file writes to MySQL, but not if the text is too long!


evmaster

Recommended Posts

Hey everyone,

I'm trying to set up a system that lets me post messages on my blog by email.

I have an email address set up so that any mail sent to it will be written into the blog's MySQL database (Subject -> message title | Body -> message body).
I have a line of code that emails a notification message to my email account just so I know the script has worked.
Everything works perfectly, as long as the message is short. If the message is longer than about 2 sentences then nothing will be written into the MySQL, but I still get the notification email which shows the message as I sent it.

Using PHPMyAdmin to insert values works fine, no matter how long, and all the other scripts I have tried with my server haven't given me trouble - it seems to have something to do with the fact that the data from an email message.

I've attached the script that's giving trouble, with the login info removed of course.

Thanks for your time,
Evan

[attachment deleted by admin]
Link to comment
Share on other sites

Thanks. It says "You have an error in your SQL syntax".
I just tried it with a 5 paragraph block of lorem ipsum text and it worked fine - so the problem is not the length of the message, but rather the use of odd characters in the message like quotes or apostrophes.
What could cause this issue? It hasn't been a problem before.

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