in reply to fetchrow_array does not yield the same results as the sql query by itself does.

Are you using a database with transactions? If so, are you sure all the data you expect to see in that loop was committed when the transaction it runs in was started?
  • Comment on Re: fetchrow_array does not yield the same results as the sql query by itself does.

Replies are listed 'Best First'.
Re^2: fetchrow_array does not yield the same results as the sql query by itself does.
by Hue-Bond (Priest) on Sep 06, 2006 at 19:54 UTC

    But the point of transactions is to perform some work atomically, isn't it? On commit, the DB engine arranges to show the results of all queries as if they were executed at one instant in time. So there's no way of seeing the results of part of a transaction. Or am I wrong?

    --
    David Serrano

      Isolation levels are more complex than that. Depending on how you have things set, you may not be able to see data that was committed by other processes after the start of a transaction. For more on how this works, see this. It's from the MySQL docs, but PostgreSQL and Oracle work this way too.

      UPDATE: corrected link