March 17, 2011

sqlite pdo write lock problem solved

When using PHP and PDO to access an sqlite dababase, and when you do a "select *" using the $handle->query($sqlcmd), you must use "foreach" to read all the select results before you can issue the next "query" or "exec" call. Otherwise, the database will be locked.

1 comment:

  1. Hi guy, thank you for your post, you helped me a lots, I've been blocked a whole day for that thing.
    I sent a post on identi.ca telling you rock ;-)

    ReplyDelete