bobleny Posted October 7, 2007 Share Posted October 7, 2007 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 https://forums.phpfreaks.com/topic/72142-solved-this-string-will-not-pass-through-mysql-i-dont-know-why/ Share on other sites More sharing options...
fenway Posted October 7, 2007 Share Posted October 7, 2007 You have an unescaped single quote... Link to comment https://forums.phpfreaks.com/topic/72142-solved-this-string-will-not-pass-through-mysql-i-dont-know-why/#findComment-364029 Share on other sites More sharing options...
bobleny Posted October 7, 2007 Author Share Posted October 7, 2007 Good God! I was going up and down that string and never seen it! I was missing one little tiny piece of code, just one line....... Thanks for the help fenway! Link to comment https://forums.phpfreaks.com/topic/72142-solved-this-string-will-not-pass-through-mysql-i-dont-know-why/#findComment-364052 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.