Skip to main content
Participant
January 3, 2008
Question

mySQL 1064 error

  • January 3, 2008
  • 4 replies
  • 1205 views
I am using Dreamweaver, mySQL, and PHP to build a db query and present it in a table. I can create a recordset and add the select statement by cut-and-paste (it has sub-selects in it). The "test" button shows the query properly but once it is inserted the "Bindings" tab it produces a 1064 error 'near '' at line 2'. The table actually loads properly in a browser but the "Bindings" is not correct and the recordset sometimes disappears from the tab. Now I have multiple versions of the recordset in the code but nothing in the tab. Is the query too complex? Do I need to do something else?
This topic has been closed for replies.

4 replies

Participant
March 10, 2017

I was facing this problem earlier but now I have solved this problem by changing the name of the database. Actually, I was using a space in my database name. As i change the  database name abc abc with abcabc the problem resolved. 

Inspiring
January 4, 2008
wiliamc wrote:
> The problem is not the multiple recordsets because I can edit them out. The
> problem is that the query returns the error: 'MM_ERROR: MySQL Error#: 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 '' at line 2'

MySQL error 1064 is a parse error. You say that the query works fine
when you click Test, and that it runs fine in MySQL. In other words, it
runs fine in isolation, but in the context of your page, it generates a
parse error. Without seeing your code, it's impossible to be 100% sure,
but it almost certainly means that you have created a dog's dinner of
code by attempting to insert the recordset multiple times. The main clue
is the fact that the error message says "line 2". MySQL error messages
resulting from Dreamweaver code always refer to "line 1" because the SQL
is submitted to MySQL as a single line.

MySQL parse errors are impossible to troubleshoot just by looking at the
error message because the message always says "near xyz on line 1". What
this actually means is that the error is directly before xyz. So, to see
the actual problem, you need to look at the SQL query itself. Since your
error message refers to line 2, I suspect that the PHP code generated by
Dreamweaver is building a hybrid query.

One other possibility is that you're trying to run two queries
simultaneously. The PHP mysql_query() function used by Dreamweaver can
handle only one query at a time (as a security measure).

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
wiliamcAuthor
Participant
January 4, 2008
Thanks for your quick reply David.

The problem is not the multiple recordsets because I can edit them out. The problem is that the query returns the error: 'MM_ERROR: MySQL Error#: 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 '' at line 2' and the recordset is not functional nor recognized by any of the data-aware controls, even though the query runs in the 'Test' button when the recordset is created (and it works fine in MySQL).

Bill
Inspiring
January 3, 2008
wiliamc wrote:
> Now I have
> multiple versions of the recordset in the code but nothing in the tab. Is the
> query too complex? Do I need to do something else?

It sounds as though you're not editing the code properly. There should
not be "multiple versions of the recordset in the code". Start again
with a clean page.

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/