Welcome Guest, Not a member yet? Register   Sign In
PDO?
#1

[eluser]Ken Verhaegen[/eluser]
Here's a question:

Is CI using PDO or regular (old) connection methods to connect to a database?

PDO = PHP Data Objects
A multiple use (not just one database connection), faster and easier way to connect to any database where there's a driver for available.
PHP had it for some time available, but since PHPv5.1 it's activated from start.

I didn't even care to look for it myself in the CI package,
that's why I'm asking here, and maybe the answer is a better source of information for newer users.

Good little tutorials from net.Tuts: Why you should use PDO to connect to a database.
#2

[eluser]Twisted1919[/eluser]
NO, CI is using plain php classes as it's database drivers(no dependency on PDO whatsoever).

It would be a nice improvement in CI, and i am sure it'll be implemented sometime in the near future.

Quote:I didn’t even care to look for it myself in the CI package,
You're lazy ? or you didn't knew what to look for (heard of PDO and came here in a heartbeat asking if CI has it or not)?
#3

[eluser]Ken Verhaegen[/eluser]
[quote author="Twisted1919" date="1305241570"]...
You're lazy ? or you didn't knew what to look for (heard of PDO and came here in a heartbeat asking if CI has it or not)?[/quote]

I'm not lazy, and yes I know what to look for, I just did by the way Tongue
Just didn't have a clean copy of CI anymore.
The question was mainly to answer other people's questions when they search for PDO in the forums:

Quote:maybe the answer is a better source of information for newer users


I was also asking this, because I learned scripting OOPHP, finally (I do know PHP), and I came up on a part where PDO didn't even work properly on PHPv5.2.x, even if I checked and re-checked the code I typed...
The error handling ain't so great I suppose... (try>catch doesn't work with it ?)
Then I found a way to see the actual PDO errors,... I fixed those but...
PDO was working slow, and my page didn't even load as fast as it should be,
not mentioning the empty array's I get, even though the right amount is showing.
Trial & Error in progress Wink

PDO is fine, but being a first-time-user made me kinda wondering...
And than I made this topic (Cool Story Huh? Tongue)
#4

[eluser]Twisted1919[/eluser]
My bad if the reply looked a bit "acid", it was written in a hurry .

PDO is the way of using databases with PHP mainly because it is part of PHP package and only that provides more speed, but there are so many other advantages like multiple RDBMS support, prepared statements etc etc.

Ah, PS:
Once CI team will implement PDO, this implementation will also fix the database transactions (having in mind that CI transaction implementation isn't working as it should, this being an issue from 1.7.0 or so as far as i know)
#5

[eluser]Ken Verhaegen[/eluser]
Don't worry Tongue I didn't feel a thing of your acidness, it's just all melting away now :')
(Humor. Said enough Big Grin)

I've had some problems with those transactions before, that's why I don't use CI yet, for bigger projects.
Maybe someone should work on a new (PDO) Database Controller for CI, hmmm, let's see. Big Grin
#6

[eluser]Twisted1919[/eluser]
You have alternatives, YII, Kohana, Cake, etcSmile
Go with one of those till CI implements PDO (tho when it does, you won't come back Smile) )
#7

[eluser]Ken Verhaegen[/eluser]
YII is for wannabe's (too easy Tongue)
Kohana looks sweet, but so does CI... still!
And Cake, just nonsense Tongue




Theme © iAndrew 2016 - Forum software by © MyBB