Announcement

Collapse
No announcement yet.

Grid Advanced Search : Error while accessing the database

Collapse
This topic is closed.
X
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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)

  • #2
    Could it be that the ';' is causing this problem?

    from vwproctor; where
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

    Comment


    • #3
      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

      Originally posted by aducom View Post
      Could it be that the ';' is causing this problem?

      from vwproctor; where
      I bet it was that, altough in his case, the query was badly constructed.
      Best Regards

      Daniel Salcedo
      • Software & Hardware developer
      • Photography enthusiast
      • Ultimate Frisbee lover

      Comment


      • #4
        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

        Comment


        • #5
          Thread solved
          /Giuseppe

          Professional Scriptcase Services
          Some Customers opinions

          Comment

          Working...
          X