Hello everyone.
I've got a question that I can't find the right anser to on the web. With php now supporting OOP that allows for faster execution of code, What the best why to query MySQL databases with? the standered Mysql or MySQLi using OOP.
They don't call it MySQL[i]Improved[/i] for nothin
Some hosts don't support mysqli, so you might want to be careful about that.
Yer i know much, it got a load of clearup and roll back features as well as improved querying. But what does that mean in the long run with the added features?
There is no "right answer", really, it depends entirely on your situation. If you're learning from scratch, you might find there are more (and perhaps simpler) tutorials/documentation for MySQL, but MySQLi as the name suggests is technically better and recommended if you're coding for an environment where you can ensure it will be supported.
Thank! That the best anser i've head yet, for the record i can do both but ill make sure all my script have the option to uses mysqli or msql.
Thnaks :)
[QUOTE=JimTools;20164358]Thank! That the best anser i've head yet, for the record i can do both but ill make sure all my script have the option to uses mysqli or msql.
Thnaks :)[/QUOTE]
No problem. :)
The old MySQL functions (mysql_query, mysql_fetch_*, etc) will be gone in PHP 6. So I suggest you start with MySQLi. Depending on how you use it, it's virtually the same as with the old MySQL functions (mysql_query -> mysqli_query) (unless you're doing it through OOP).
I did see a interesting benchmark some time ago though. It showed that the mysqli_query() function was faster then using MySQLi' prepared statements.
I was just looking around for some stuff on mysqli in the last hour or two as I'm going to try and use that in my new project, but it seems as though there's next to no resources on how to use it. There's also basically no examples using sourcecode on php.net too (or any comments on the pages at all, from what I saw), so it just makes me wonder how much mysqli is actually used, despite it being "very strongly recommended" compared to the standard mysql functions.
Is MySQLi in all PHP 5.2+ installations or is it a non-mandatory module?
[QUOTE=a2h;20184005]Is MySQLi in all PHP 5.2+ installations or is it a non-mandatory module?[/QUOTE]
As far as I know it's optional, given you're supposed to compile PHP with it or put it in the extensions directory yourself. Except, as it's highly recommended [b]I think they've put it in there themselves[/b], as it's in both my web host and also in XAMPP, and it's enabled in both spots.
Sorry, you need to Log In to post a reply to this thread.