4

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.

CL.
  • 173,858
  • 17
  • 217
  • 259
cantsay
  • 1,967
  • 3
  • 21
  • 34
  • everything's moving away from db-specific function sets to just using PDO. get used to PDO... – Marc B Sep 14 '15 at 17:52
  • 1
    "Procedural" as opposed to what? What is the problem with the 'normal' code? – CL. Sep 15 '15 at 08:57
  • 2
    @CL. I write my scripts in procedural code, as opposed to OOP (using classes, etc). It just seems bad mixing procedural and OOP code – cantsay Sep 16 '15 at 06:23

1 Answers1

2

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.