How to output XML from a regular SQL query?

What does "#1064 - You have an error in your SQL syntax" mean in MySQL?

  • I was trying to update my phpBB forum earlier, and accidently deleted my database. When I tried to restore it from the backup on my hard disk, I got a punctuation error. As I am new to MySQL, I don't understand which part of the punctuation is causing a problem. Can anyone help please? The exact error was: Error There seems to be an error in your SQL query. The MySQL server error output below, if there is any, may also help you in diagnosing the problem ERROR: Unknown Punctuation String @ 182 STR: /> SQL: # # TABLE: phpbb_privmsgs # <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link rel="stylesheet" href="../templates/BlueGreen/admin/admin… type="text/css"> <title>Gandiseeg - </title> <style> body, p, td { font-size: 11px; SQL query: # # TABLE: phpbb_privmsgs # <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link rel="stylesheet" href="../templates/BlueGreen/admin/admin… type="text/css"> <title>Gandiseeg - </title> <style> body, p, td { font-size: 11px; MySQL said: #1064 - 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 '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <' at line 4

  • Answer:

    It looks as though the restore operation is failing because it is trying to process unescaped HTML in the SQL query. I would imagine that the phpBB3 support forums would have experienced this before and may be able to help you more. Alternatively, if you can think of some way to escape the SQL string (using the JavaScript escape function or the PHP mysql_escape_string with htmlentities functions) then that might resolve the issue.

Dezzy1 at Yahoo! Answers Visit the source

Was this solution helpful to you?

Other answers

We can't help you without the query in question. What you listed as an SQL query is NOT an SQL query. I'm guessing you're not using an SQL query at all, it looks like you're trying to process raw HTML as an SQL query.

Kind_Lad

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.