Re: MySQLi Compat question
| From: | Robin Ericsson | Date: | Mon, 09 Jun 2003 17:15:14 +0000 |
| Subject: | Re: MySQLi Compat question | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-17218@lists.php.net to get a copy of this message | ||
John Coggeshall wrote:
Ok, Then I'm on track again. But I don't still don't understand why it's need to be using new names if it's BC in almost everycase? From my point of view it should be either mysql or mysqli and mysqli should be doing alias like sybase is with mssql, or I might still be wrong here :) br RobinMaybe I'm on a limb here, but I don't understand why there has to be a new mysql extension (mysqli) which have the same native functions as the mysql extension (mysqli_connect, etc)The new mysqli extension is a major improvement over the mysql extension on many levels.. it is based off of MySQL 4.1, and the implementation of the API itself is much easier to maintain. mysqli supports things like bindings, etc as well... it's really a major improvement over the old extension and is still BC (at least from a functional standpoint) with 3.23 servers. There's also a great deal of efficiency gained with the new extension as well. Hope that answers your question :)From what I remember mysqli should be an OO extension to mysql, but my memory might be week :)That's partially true. MySQLi is actually a hybrid (which is really cool)... what it does is $mysql = mysqli_connect(...); $result = mysqli_query($mysql, "SELECT * FROM foo"); but at the exact same time, the following is also acceptable: $mysql = mysqli_connect(...); $result = $mysql->query("SELECT * FROM foo"); i.e. statement, connection, and result resources (I think results are in there too, I'd have to double-check) can be accessed both as objects or as just resources.