Wednesday, June 24, 2009

PHP SQLite 3 exec not working

I've spent at least a week wondering why my db->query statements work on my PHP files whereas the db->exec randomly seems to work or ceases working. This is mostly with the PDO opening of SQLite 3 onwards, where it behaves almost read-only.

Turns out, not only do you need to allow write access to the database file itself, but also to the folder containing it. Some google searches also seem to suggest that the full path needs to be given. But trust me - simply enabling write on the directory worked. This seems like a potential security issue, though :(

P.S. - For my facebook friends being forced to read this note - sorry, I'm still trying to figure out how to decouple the RSS I had once linked. :(

2 comments:

  1. Thanks! You just saved me one week of time. You blog turn out to be the second result after php.net.

    Keep your the great work.
    Thanks for sharing.

    ReplyDelete
  2. Do you need to increase your credit score?
    Do you intend to upgrade your school grade?
    Do you want to hack your cheating spouse Email, whatsapp, Facebook, instagram or any social network?
    Do you need any information concerning any database.
    Do you need to retrieve deleted files?
    Do you need to clear your criminal records or DMV?
    Do you want to remove any site or link from any blog?
    you should contact this hacker, he is reliable and good at the hack jobs..
    contact : cybergoldenhacker at gmail dot com

    ReplyDelete