Reply to Re: Should I use mysql, mysqli or PDO?

Your name:

Reply:


Posted by Rik Wasmus on 11/05/07 08:42

On Mon, 05 Nov 2007 09:20:08 +0100, <james@jgoode.co.uk> wrote:

> On Nov 4, 1:51 pm, Jerry Stuckle <jstuck...@attglobal.net> wrote:
>> macca wrote:
>> > Hi,
>>
>> > What should I be using for general MySQL database access? I've been
>> > using the traditional mysql extension for ages, but I'm trying to
>> > update my style to a more OOP paradigm.
>>
>> > I've used PDO briefly but I've not used the mysqli extension yet.
>> > I've read a bit about it though, seems good and more OOP orientated
>> > (for the most part). But PDO seems more generic and transferable.
>>
>> > Any comments?
>>
>> > TIA
>>
>> If I'm going to be using only mysql, I use the mysqli classes. I like
>> the way they're designed and it has less overhead than PDO.
>>
> I've written my own database class using PHP's mysql functions, rather
> than using mysqli, and I've added functions to automatically get,
> insert and update. In the end, it's a lot faster than the built-in
> mysqli, and it didn't take long to write.

There's one major advantage of mysqli though: real prepared statements.
PHP doesn't know everything about the MySQL server, so escaping string can
be tricky business (especially with 'broken' Unicode, there's a very slim
possibility a quote will appear where there was none). Prepared statements
free you from that headache.
--
Rik Wasmus

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация