phpsqliteprocedural-programming

Is there a way to use procedural code with SQLite3?


I prefer to use procedural style code, is there any way to use procedural style code with SQLite3? Or is the only alternative to create the functions as aliases (which seems like a stupid idea)

I would prefer to use something like sqlite3_open() if possible but it doesn't work. If not I guess I'll install SQLite instead.


Solution

  • I've been searching for this too, I was about to write my own extension but I found this wrapper which basically allows you to use your procedural style code and hands over the queries to the PDO extension. You will still have the performance draw back of OOP but at least your code will not change drastically.

    The site is in Spanish but you can easily translate it, using chrome or pretty much any modern browser.

    Here's the link.

    https://www.javiergutierrezchamorro.com/wrapper-php-para-llamadas-procedurales-de-sqlite/

    I found it very useful.