Jump to content

[SOLVED] This string will not pass through mysql.... I don't know why....


bobleny

Recommended Posts

I'm not entirely sure why this string is a problem, but I think it has something to do with the "#" symbols, but that makes no since to me because I don't remember them ever being a problem before....

 

This is my error:

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 's deleted. Wah Lah easy as that! Next thing I am going to work out is' at line 1

 

This is the string I am trying to pass:

Sorry about the wait, but trust me when I say it will be worth it! \"It will be worth it!\" I have a lot planned for the site! I need to fix some of the looks then start on the forum.

For now though, this is what I have done. First, I changed the error reporting system so that anytime there is an error, caused by anyone, I will get a message sent to my inbox! That way, from now on, I will know where the error is and I will be able to fix it right a way!

The next thing I worked on was the mail system. I found it hard to receive the errors when they had no where to be sent to... So I mailed a mail system, which will be used for the forum. I then wanted to be able to delete my messages in my inbox, so that was next.

I then took a little side step and played with some JavaScript and AJAX. You will always know when you get mail, thanks to a little AJAX script I wrote... I also made it easier to delete your messages with a JavaScript confirmation box. If you decide you want to delete it, click on \"Delete\" and a box will pop up, click OK, and it\'s deleted. Wah Lah easy as that!

Next thing I am going to work out is the edit feature, and then I need to do a bit more with the add feature...

Oh, and the updates will come more frequent as it is easier to edit the site now!

 

This is how I am trying to pass it, where $text is the string in question:

$str = "INSERT INTO `home` (`declare`, `time`, `text`) VALUES ('" . $_POST['declare'] . "', '" . date('l, F jS\, Y') . "', '" . $text . "')";
$query = mysql_query($str);

 

 

And this is $str echoed:

INSERT INTO `home` (`declare`, `time`, `text`) VALUES ('Update:', 'Saturday, October 6th, 2007', 'Sorry about the wait, but trust me when I say it will be worth it! \"It will be worth it!\" I have a lot planned for the site! I need to fix some of the looks then start on the forum.

For now though, this is what I have done. First, I changed the error reporting system so that anytime there is an error, caused by anyone, I will get a message sent to my inbox! That way, from now on, I will know where the error is and I will be able to fix it right a way!

The next thing I worked on was the mail system. I found it hard to receive the errors when they had no where to be sent to... So I mailed a mail system, which will be used for the forum. I then wanted to be able to delete my messages in my inbox, so that was next.

I then took a little side step and played with some JavaScript and AJAX. You will always know when you get mail, thanks to a little AJAX script I wrote... I also made it easier to delete your messages with a JavaScript confirmation box. If you decide you want to delete it, click on \"Delete\" and a box will pop up, click OK, and it\'s deleted. Wah Lah easy as that!

Next thing I am going to work out is the edit feature, and then I need to do a bit more with the add feature...

Oh, and the updates will come more frequent as it is easier to edit the site now!')

 

 

So, I need some help with this.... I just don't get why the string is causing an error....

 

Thanks!

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.