•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 423,532 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,376 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser: Programming Forums
Views: 933 | Replies: 6
![]() |
| |
•
•
Join Date: Mar 2008
Posts: 3
Reputation:
Rep Power: 0
Solved Threads: 0
I am trying to insert a row into a table into a MySQL DB 5.0 table. One of the VALUES that I am inserting just so happens to be HTML code. When I execute the INSERT in MySQL Query Browser it tells me "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 "<p> This section will display the current status of the client including the con' at line 1". It is ErrorNr. 1064. Below is the INSERT statement. The text in the above error is the start of the third column in the VALUES statement.
EXAMPLE CODE
======================================
INSERT INTO `HelpTopics` (`topicID`, `topicName`, `topicContent`) VALUES (100,'Manage Client','<p>This section will display the current status of the client including the contact name, \r\n employee name, date client account was created, and whether the account is private or \r\n public. Under the Client Documents section, you will be able to quickly view categories \r\n and documents stored for this client. Document information easily viewed includes the type of file, tax year of the document, a file description or name, file size, and the date created. </p>\r\n <p>Additional features of this section are listed below. </p>\r\n <p><strong>To Edit a client:</strong> \r\n Select the <img src=\"images/edit.gif\" width=\"20\" height=\"20\" > \r\n icon above the client information after the Company Name.</p>\r\n <p><strong>To Add a sub category:</strong> \r\n Select the <img src=\"images/add.gif\" width=\"20\" height=\"20\" > \r\n icon on the right hand side of the screen in line with the desired category. </p>\r\n <p><strong>To Add a document:</strong> \r\n Select the <img src=\"images/addDoc.gif\" width=\"20\" height=\"20\" > \r\n icon on the right hand side of the screen in line with the desired category.</p>\r\n <p><strong>To Select a document:</strong> Open a category section by selecting the (+) icon of a category and click hyperlink description of a document.</p>\r\n <p><strong>To Edit a document:</strong> \r\n Select the <img src=\"images/edit.gif\" width=\"20\" height=\"20\" > \r\n icon on the right hand side of the screen in line with the desired document.</p>\r\n <p><strong>To Delete a document:</strong> \r\n (Administrators Only) Select the <img src=\"images/delete.gif\" width=\"20\" height=\"20\" > \r\n icon on the right hand side of the screen in line with the desired document.</p>\r\n <p><strong>To Edit a category:</strong> \r\n Select the <img src=\"images/edit.gif\" width=\"20\" height=\"20\" > \r\n icon on the right hand side of the screen in line with the desired category.</p>\r\n <p><strong>To Delete a category:</strong> \r\n (Administrators Only) Select the <img src=\"images/delete.gif\" width=\"20\" height=\"20\" > \r\n icon on the right hand side of the screen in line with the desired category.</p>\r\n <h3>Additional Notes :</h3>\r\n <ul>\r\n <li>Master Categories feature an expand (+) or a hide (-) icon to either view other categories \r\n listed under a category or hide categories for easy viewing.</li>\r\n <li>Categories will also feature a number in parenthesis after the category name to indicate the \r\n number of documents currently stored by that user in the category. </li>\r\n <li>A category may not be deleted unless documents are deleted from that category. </li>\r\n </ul>');
EXAMPLE CODE
======================================
INSERT INTO `HelpTopics` (`topicID`, `topicName`, `topicContent`) VALUES (100,'Manage Client','<p>This section will display the current status of the client including the contact name, \r\n employee name, date client account was created, and whether the account is private or \r\n public. Under the Client Documents section, you will be able to quickly view categories \r\n and documents stored for this client. Document information easily viewed includes the type of file, tax year of the document, a file description or name, file size, and the date created. </p>\r\n <p>Additional features of this section are listed below. </p>\r\n <p><strong>To Edit a client:</strong> \r\n Select the <img src=\"images/edit.gif\" width=\"20\" height=\"20\" > \r\n icon above the client information after the Company Name.</p>\r\n <p><strong>To Add a sub category:</strong> \r\n Select the <img src=\"images/add.gif\" width=\"20\" height=\"20\" > \r\n icon on the right hand side of the screen in line with the desired category. </p>\r\n <p><strong>To Add a document:</strong> \r\n Select the <img src=\"images/addDoc.gif\" width=\"20\" height=\"20\" > \r\n icon on the right hand side of the screen in line with the desired category.</p>\r\n <p><strong>To Select a document:</strong> Open a category section by selecting the (+) icon of a category and click hyperlink description of a document.</p>\r\n <p><strong>To Edit a document:</strong> \r\n Select the <img src=\"images/edit.gif\" width=\"20\" height=\"20\" > \r\n icon on the right hand side of the screen in line with the desired document.</p>\r\n <p><strong>To Delete a document:</strong> \r\n (Administrators Only) Select the <img src=\"images/delete.gif\" width=\"20\" height=\"20\" > \r\n icon on the right hand side of the screen in line with the desired document.</p>\r\n <p><strong>To Edit a category:</strong> \r\n Select the <img src=\"images/edit.gif\" width=\"20\" height=\"20\" > \r\n icon on the right hand side of the screen in line with the desired category.</p>\r\n <p><strong>To Delete a category:</strong> \r\n (Administrators Only) Select the <img src=\"images/delete.gif\" width=\"20\" height=\"20\" > \r\n icon on the right hand side of the screen in line with the desired category.</p>\r\n <h3>Additional Notes :</h3>\r\n <ul>\r\n <li>Master Categories feature an expand (+) or a hide (-) icon to either view other categories \r\n listed under a category or hide categories for easy viewing.</li>\r\n <li>Categories will also feature a number in parenthesis after the category name to indicate the \r\n number of documents currently stored by that user in the category. </li>\r\n <li>A category may not be deleted unless documents are deleted from that category. </li>\r\n </ul>');
Last edited by aaronknightkc : Mar 2nd, 2008 at 2:04 am.
•
•
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,098
Reputation:
Rep Power: 8
Solved Threads: 240
Your insert query works fine on my computer. Check if you have the column names right. Also escape all the special characters using addslashes .
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
*PM asking for help will be ignored*
*PM asking for help will be ignored*
•
•
Join Date: Dec 2007
Posts: 113
Reputation:
Rep Power: 1
Solved Threads: 13
Always use mysql_error() to debug mysql errors in when working with PHP.
Use addslashes() as nav33n suggested or use mysql_real_escape_string().
Use addslashes() as nav33n suggested or use mysql_real_escape_string().
•
•
Join Date: Mar 2008
Posts: 3
Reputation:
Rep Power: 0
Solved Threads: 0
Actaully just figured out the issue. When this data was dumped into its file there were some tab characters that worked there way in there. Crazy... Thanks for all the help. This is the first time I have used a forum like this. I got all these responses in the first 24 hours. Thanks againn for all the help. I will be on this forum a lot from now on.
![]() |
•
•
•
•
•
•
•
•
DaniWeb MySQL Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
access activation api blogger blogging blogs code combo cross-browser javascript menu with few lines of code css dani daniweb data deleting records from ms sql table where columns have duplicate values development div dropdownlist equivalent code of messagebox in asp.net firefox gdata google google checkout google checkout vat gpl html html api innovation javascript key linux microsoft module net news openbsd product programming reuse rss serial source symantec tables tags vista w3c web wysiwyg xml
- JSTL compare string (JSP)
- Warning: mysql_connect(): Access denied (PHP)
- Problems in inserting data into MySQL table from JSP.... (JSP)
- java.lang.NoClassDefFoundError: java/lang/StringBuilder (Java)
- Variable passed to each() is not an array (PHP)
- Trying to return query results (ColdFusion)
- This Should be Easy for You Guys! (Linux Servers and Apache)
- This ought to be simple - extra spaces (PHP)
- Problems with first php file (PHP)
Other Threads in the MySQL Forum
- Previous Thread: Help required with .sql file!
- Next Thread: SQL query program to edit records



Hybrid Mode