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]
The first thing to do is check for errors from your mysql query

[code=php:0]mysql_query($createquery) or die("Error in $createquery :" . mysql_error());[/code]

Or you may want to add that error to the email notification.
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

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.