s0c0 Posted January 31, 2007 Share Posted January 31, 2007 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? Quote Link to comment Share on other sites More sharing options...
Nameless12 Posted January 31, 2007 Share Posted January 31, 2007 In short mysqli is better than mysql_*, but I would not use either of these I would instead use PDO. If you dont know what pdo is, its one interface that can connect to a whole range of database not just mysql. Quote Link to comment Share on other sites More sharing options...
utexas_pjm Posted January 31, 2007 Share Posted January 31, 2007 [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 Quote Link to comment Share on other sites More sharing options...
Hypnos Posted February 7, 2007 Share Posted February 7, 2007 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/686http://devzone.zend.com/node/view/id/687Edit: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 Link to comment Share on other sites More sharing options...
effigy Posted February 7, 2007 Share Posted February 7, 2007 [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. Quote Link to comment Share on other sites More sharing options...
Nameless12 Posted February 17, 2007 Share Posted February 17, 2007 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. Quote Link to comment Share on other sites More sharing options...
Stopofeger Posted February 22, 2007 Share Posted February 22, 2007 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.