Grid Advanced Search : Error while accessing the database

What could be causing these errors when I try to run the Advanced Search on a grid?
Ed

Error
Error while accessing the database:
Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.
select distinct LastName from vwproctor; where LastName = ‘’

Error
Error while accessing the database:

SelectLimit(SELECT login, FirstName, LastName, ProctorStatusCode, PrimaryPhone, Email, City, State, MiddleName, ProctorId from vwproctor; where State like ‘%FL%’, 22, 0)

Could it be that the ‘;’ is causing this problem?

from vwproctor; where

I was just trying to solve a request of a customer which required some tricky queries, so I turned on SQL debug to confirm that they worked, but as I was getting tons of statements, I decided to add some “tags” to my queries to find them easily, so I did something like this:

SELECT sum(price) FROM my_table WHERE id >50;-- this

The idea was that the way MySQL handles comments, I could see the “this” but it wont hurt my code, nevertheless, I started getting the same error.

Why I’m replying here? Just to prevent anyone around: Try to avoid putting anything after a “;” on a Query, even if it’s not intended to be executed, so the PDO wont interpret it like a double state

[QUOTE=aducom;38031]Could it be that the ‘;’ is causing this problem?

from vwproctor; where[/QUOTE]

I bet it was that, altough in his case, the query was badly constructed.

Thanks for the extra pairs of eyes. Your right about the semi-colon. I should have caught that myself. I may have fat fingered something to cause this error.
Ed

Thread solved