PHP ORM Feedback requested [message #173276] |
Fri, 01 April 2011 06:21 |
Bharadwaj
Messages: 1 Registered: April 2011
Karma: 0
|
Junior Member |
|
|
Hi,
I have been looking for a very light weight PHP ORM library and I came
up with a few choices. Most choices require some form of
configuration, e.g. adding more fields to the class and many of them
are not so intuitive.
I do not want to use a framework, but prefer just the ORM for Q&D
prototypes.
Anyway, I built my own PHP ORM library called SORM (Simple ORM). You
can checkout the code and examples at
https://github.com/teraom/sorm.
I would appreciate if you can provide some feedback or directions on
how to proceed, things to change etc.
I want to use mysqli for database queries, specifically for prepared
statements, so as to avoid SQL injection.
1. Is there a way to use prepared statement with regular PHP - SQL
functions?
http://us2.php.net/manual/en/ref.mysql.php
2. Is mysqli installed by default when you install PHP? (PHP 5.2 and
above)
Thanks,
Bharad
|
|
|
Re: PHP ORM Feedback requested [message #173279 is a reply to message #173276] |
Fri, 01 April 2011 07:51 |
alvaro.NOSPAMTHANX
Messages: 277 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
El 01/04/2011 8:21, Bharadwaj escribió/wrote:
> I have been looking for a very light weight PHP ORM library and I came
> up with a few choices. Most choices require some form of
> configuration, e.g. adding more fields to the class and many of them
> are not so intuitive.
> I do not want to use a framework, but prefer just the ORM for Q&D
> prototypes.
>
> Anyway, I built my own PHP ORM library called SORM (Simple ORM). You
> can checkout the code and examples at
>
> https://github.com/teraom/sorm.
I'm afraid I don't have time to provide feedback but good luck anyway :)
>
> I would appreciate if you can provide some feedback or directions on
> how to proceed, things to change etc.
> I want to use mysqli for database queries, specifically for prepared
> statements, so as to avoid SQL injection.
I suppose it's a matter of opinion but I tried mysqli once and I really
hated it. It has a pretty complicate and incoherent API. I've found PDO
way nicer.
> 1. Is there a way to use prepared statement with regular PHP - SQL
> functions?
> http://us2.php.net/manual/en/ref.mysql.php
Not natively. You can write a custom abstraction layer on top of it and
emulate the feature with some string handling (I've done it and it's not
too complicate) but it'll always be a hack (e.g., parsed statements
cannot be cached). On the contrary, both mysql and PDO have provide it.
> 2. Is mysqli installed by default when you install PHP? (PHP 5.2 and
> above)
It's not built-in in the main binary, if that's what you ask, so it can
be enabled and disabled, just like good old mysql extension. (My hosting
provider includes, if that helps you to make a little survey.)
--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--
|
|
|