tags:

views:

61

answers:

4

I know OO is the "way to go" but I'm thinking procedural might be easier to use in the wrapper I'm making.

Any difference in performance between MySQLi Object Oriented vs Procedural?

+1  A: 

Not really. There might be a very slight difference, but it's largely negligible. The object-oriented one is, in my opinion, much easier to use, though, even if you are making a wrapper over it anyway.

musicfreak
+1  A: 

The difference is not in regards to MySql or MySqlI but main the fact of using objects over procedural,

Using objects will create reusable code, this being said your applications will be smaller and they tend to have less memory/resource usage.

My Advice is get started with PDO Its an Abstraction layer writter for PHP and is available for several different database servers such as mysql(i)

Read more about the usage here: http://php.net/manual/en/book.pdo.php

RobertPitt
A: 

I would suggest checking out the Doctrine Project. They have a great ORM, but if you just want to use the DB abstraction, they've actually separated the DAL out into another project, for people who don't want to use the ORM.

Travis
+1 fro Doctrine and DAL, Although i dont like DAL, i would rather use PDO
RobertPitt
PDO is probably more suitable for the OP at this stage. Doctrine is way too huge.
Lotus Notes
Why is it too huge? If he's writing this to learn, go OO MySQLi, if not there is no way he will save time writing his own wrapper when Doctrine has solved the problem already, and done it well.
Travis
I'm not writing it to learn -- writing it for production. I have based a few systems (this started as the same MySQL wrapper that WordPress uses) but I'm trying to shift it to MySQLi
Kerry
+4  A: 

This is premature optimization. There's no difference, unless you're really crunching for picoseconds and femtoseconds.

Edit: which you will NOT be crunching.

Lotus Notes
+1 if optimizing picoseconds were this important in your app, you wouldn't be using PHP! :-)
Bill Karwin