Skip navigation links

MySQL Forums :: PHP :: Error Code: 1064 - You have an error in your SQL syntax;


Advanced Search

Error Code: 1064 - You have an error in your SQL syntax;
Posted by: Shared Media ()
Date: March 09, 2006 10:15AM

Hello..

I am a savey Fedora nut, now dabbling into MySQL. I am comfortable with code and structure however one of my "PHP" projects is giving me a little headache.. I'm coding up a small document management system for my work, using php 5 and MySQL 4.11 (the one under 5) everything works great as in SugarCRM, websites, Mambo...

Hopefully I am in the right forum...

My document project is working ok, the ONLY error I receive is when I add a word that has an apostophy s ( like this: word's ). I have to type it like this.. ( word\'s ). Then it takes it and saves it...

I am wondering if my "settings" for the database/tables are incorrect... like charactor set or type... So now that I have confused everyone, I will try and explain....

I have a database called "Atheneaum", all the tables (7 in total :)) inside is set as this:
TYPE: MyISAM
COLLATION: latin1_swedish_ci

When I login to my document manager Atheneaum I can post an announcement and documents. Everything works except when adding a description or content of the "announcement" in the WYSIWYG editor with any words using the apostrophy S. I have to put a slash before the 's.

Sample:
"This document is for Sarah's eyes only." <---I want to enter this.
"This document is for Sarah\'s eyes only." <---- Is the format I have to use to get the apostrophy to be displayed and the text saved..


Here is my error message...
Error Code: 1064
• Descriptiono: 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 eyes only, ' at line 1
• Query: UPDATE sys_announcement SET announcement_text = 'MySQL Sarah's eyes only.', announcement_creator = '3', announcement_created = '1141867169' WHERE announcement_id = '10';


My actual Table setting for this particular table is this...
FIELD TYPE COLLATION ATTRIBUTES NULL DEFAULT EXTRA
announcement_text mediumtext latin1_swedish_ci no

So if this makes sense, and you hav'nt started drinking yet.,.. I welcome your thoughts, and look forward on your suggestions and appreciate your help.

Options: ReplyQuote


Subject Written By Posted
Error Code: 1064 - You have an error in your SQL syntax; Shared Media 03/09/2006 10:15AM
Re: Error Code: 1064 - You have an error in your SQL syntax; Peter Brawley 03/09/2006 12:30PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.