Jump to content

MYSQLI vs MYSQL and InnoDB vs MyISAM


s0c0

Recommended Posts

Which should i use for performing mysql queries etc... via php mysql or the newer mysqli connector.  The book I'm reading tells me to use mysqli, but I read otherwise on the web.  The book is PHP and MySQL web devevlopment by Luke Welling and Laura Thomson.

Also is InnoDB better than MyISAM.  I know MyISAM can't do fk-pk relations, so what is it good for?
Link to comment
https://forums.phpfreaks.com/topic/36454-mysqli-vs-mysql-and-innodb-vs-myisam/
Share on other sites

[quote]
If you dont know what pdo is, its one interface that can connect to a whole range of database not just mysql.
[/quote]

I believe pdo is available only on >= PHP5.  Adodb is another db abstraction layer that allows for generic data soruces and will run on PHP4 (http://adodb.sourceforge.net/).

Best,

Patrick
PDO is more for abstraction. If you're only using MySQL and plan on only using MySQL, then use mysql_ or mysqli_ functions. PDO will just slow your scripts down.

If you're making new code from scratch and you know that you're always going to have PHP 5.0+ and MySQL 4.1+ on your webserver, use mysqli.

mysqli is really some amazing stuff, once you get in to it.

http://devzone.zend.com/node/view/id/686
http://devzone.zend.com/node/view/id/687

Edit:
I saw that you mentioned you read this from a book. If you're just starting PHP, you might want to learn the more widely used mysql_ functions first, since about 95% of the PHP/MySQL scripts use them, and they are simple.
[quote author=s0c0 link=topic=124838.msg517858#msg517858 date=1170229416]
Also is InnoDB better than MyISAM.  I know MyISAM can't do fk-pk relations, so what is it good for?
[/quote]

See [url=http://www.phpfreaks.com/forums/index.php/topic,112949.0.html]this[/url] topic.
  • 2 weeks later...

PDO is more for abstraction. If you're only using MySQL and plan on only using MySQL, then use mysql_ or mysqli_ functions. PDO will just slow your scripts down.

 

PDO is not an abstraction layer it is merely an interface for all the popular databases, it is also unfair to compare something so general as pdo to a driver designed specifically for MYSQL in terms of features and speed. and there are reasons I think learning any mysql extension is a bad idea. It is better to learn one DB API as opposed to one for postgres, one for mysql, another for mssql, and one more for oracle.

 

Innodb is basically for huge sites/db's that has to perform thousand queries per second and needs to handle gigs of data. It also supports transactions and table locking. So in short, For the biggies.

 

While MyIsam is suitable for all the avarage stuffs. So you choose.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.