Welcome Guest, Not a member yet? Register   Sign In
Query Binding Error
#1

[eluser]jleequeen[/eluser]
I'm getting the following error message:

Quote:A Database Error Occurred

Error Number: 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 '? AND year = ? AND type = ?' at line 1

SELECT SUM(metered_use + non_metered_use) as total_amount FROM connections WHERE pwsid = ? AND year = ? AND type = ?

Any ideas?
#2

[eluser]Bramme[/eluser]
try and put ? between ''
#3

[eluser]jleequeen[/eluser]
I actually have figured out the problem now, but thanks for your reply. I had a uncommented extra call which tried to run the query twice and gave the unexpected error. It was just confusing since the code is nowhere near line 1 and the part of the code I was looking at was all correct.




Theme © iAndrew 2016 - Forum software by © MyBB