Re: Question about sqli class

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Both ext/mysql and ext/mysqli work exclusively with MySQL databases.  They could not talk to SQLite, which is a different database engine entirely.

If you have the choice and are using MySQL 5 and PHP 5, ext/mysqli is generally faster than ext/mysql.  More importantly, it supports native prepared statements which is easier to use and more secure than trying to do your own escaping.

Better still would be to use PDO, which provides the advantages of ext/mysqli and supports a half dozen databases using the same (or nearly the same) OO API.  

Even better than that is to write your own thin wrapper API and then use mysqli or PDO under the hood.  Then if necessary you can switch from one to another with only minimal impact on your application code.

Whether the API is OO or function-oriented doesn't make a huge difference.  Prepared statements do.

--Larry Garfield

On Sun, 30 Dec 2007 20:11:16 +0100, alvaro <iorm@xxxxxxxxxxxxx> wrote:
> I don´t know if this is the correct place to ask this questions but I
> haver some doubts about using mysqli class in php. I am designing a web
> place using wamp2 (php5, mysql 5.0.x ....). My databases have been done
> using phpmyadmin so they are "normal" mysql, I mean that I have done
> nothing with SQLITE. On the other hand, I am accessing to my databases and
> tables using mysqli class and methods  for example:
> $conn = new mysqli ( ..........)      (this is what I am using)
> I am using that because I read in the internet that mysqli methods where
> more efficient but I don´t know if it´s correct to use that methods with
> my mysql database (it runs perfect).
> 
> so... is it correct?  supposing that it´s correct to use it......is it
> faster and better to use mysqli methods than using the functions that were
> used before these new classes appeared?
> 
> thanks...
> 
> my email is:
> iorm@xxxxxxxxxxxxx
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux