bogdaniel Posted November 7, 2008 Share Posted November 7, 2008 What is your opinion for a php framework ? To use the mysqli class from php or to build one from scratch ? Quote Link to comment https://forums.phpfreaks.com/topic/131806-mysql-class-vs-mysqli-class-for-frameworks/ Share on other sites More sharing options...
kickassamd Posted November 7, 2008 Share Posted November 7, 2008 I built my own class, that can handle both mysql and mysqli extensions. The reason I use my own is for error reporting, query logging and many other items that help me out in development. Quote Link to comment https://forums.phpfreaks.com/topic/131806-mysql-class-vs-mysqli-class-for-frameworks/#findComment-684818 Share on other sites More sharing options...
Mchl Posted November 7, 2008 Share Posted November 7, 2008 mysqli is recommended extension to use with MySQL 4.1 and higher. So unless you need to connect to older versions, there's no reason to use mysql extension. Even if you build your own class, you should base it on mysqli not mysql. Quote Link to comment https://forums.phpfreaks.com/topic/131806-mysql-class-vs-mysqli-class-for-frameworks/#findComment-684828 Share on other sites More sharing options...
genericnumber1 Posted November 8, 2008 Share Posted November 8, 2008 PDO ? Quote Link to comment https://forums.phpfreaks.com/topic/131806-mysql-class-vs-mysqli-class-for-frameworks/#findComment-684973 Share on other sites More sharing options...
kickassamd Posted November 8, 2008 Share Posted November 8, 2008 Agreed if you are making your own class, center it around the newer mysqli extension. My class can use both "drivers" since I do alot of development and not all clients have access to mySQL v4.1+. Quote Link to comment https://forums.phpfreaks.com/topic/131806-mysql-class-vs-mysqli-class-for-frameworks/#findComment-685049 Share on other sites More sharing options...
Mchl Posted November 8, 2008 Share Posted November 8, 2008 PDO ? Only if you're actually going to create code, that will work with all, or most supported databases. If you use PDO, and then use MySQL specific functions and statements, there's no point. Quote Link to comment https://forums.phpfreaks.com/topic/131806-mysql-class-vs-mysqli-class-for-frameworks/#findComment-685203 Share on other sites More sharing options...
Daniel0 Posted November 8, 2008 Share Posted November 8, 2008 I don't understand why people add polls to such topics. If I can get 6 people to say that 2+2=5 and only 4 people to say that 2+2=4 then it doesn't mean the former is correct. Quote Link to comment https://forums.phpfreaks.com/topic/131806-mysql-class-vs-mysqli-class-for-frameworks/#findComment-685210 Share on other sites More sharing options...
Mchl Posted November 8, 2008 Share Posted November 8, 2008 And the poll here lacks at least two or three other possibilities. Quote Link to comment https://forums.phpfreaks.com/topic/131806-mysql-class-vs-mysqli-class-for-frameworks/#findComment-685211 Share on other sites More sharing options...
genericnumber1 Posted November 8, 2008 Share Posted November 8, 2008 PDO ? Only if you're actually going to create code, that will work with all, or most supported databases. If you use PDO, and then use MySQL specific functions and statements, there's no point. Well I didn't see him specify that, so I was just adding my 2 cents. Even if you use PDO_MYSQL it would be easier to switch to something like mssql than if you used mysqli. Quote Link to comment https://forums.phpfreaks.com/topic/131806-mysql-class-vs-mysqli-class-for-frameworks/#findComment-685512 Share on other sites More sharing options...
Mchl Posted November 8, 2008 Share Posted November 8, 2008 Agree on that. Quote Link to comment https://forums.phpfreaks.com/topic/131806-mysql-class-vs-mysqli-class-for-frameworks/#findComment-685523 Share on other sites More sharing options...
genericnumber1 Posted November 8, 2008 Share Posted November 8, 2008 On the other hand, mysqli is quicker than PDO, so you give and take. Quote Link to comment https://forums.phpfreaks.com/topic/131806-mysql-class-vs-mysqli-class-for-frameworks/#findComment-685534 Share on other sites More sharing options...
the182guy Posted November 11, 2008 Share Posted November 11, 2008 If you just need some custom functions and things like query logging, why create your own class, having to create all the basic methods like query, fetch_assoc, error, when you can just create a class that extends MySQLi. Then all the methods are available, you can add whatever you want, and you can overide whatever you want, e.g. for doing query logging. Quote Link to comment https://forums.phpfreaks.com/topic/131806-mysql-class-vs-mysqli-class-for-frameworks/#findComment-687981 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.