I was wondering if the older mysql_* functions provided with php will work with a mysqli connection.
No, the mysql_* functions were used only with the mysql driver.
There are new functions created for using with mysqli which you can read more about here.
The new method is object oriented instead of the old functional style.
No, they won't, they're two entirely difference resources.
Unless you're trying to do a drop-in replacement of a MySQL connection with a MySQLIi connection, there's not much need for you to worry about this, unless you can't stand writing the i
every time :-P
Remember though that you can still connect to newer MySQL databases with the mysql_*
commands.
The mysql extension uses resources for the link identifier:
There are two resource types used in the MySQL module. The first one is the link identifier for a database connection, the second a resource which holds the result of a query.
MySQLi does not provide any resources:
This extension has no resource types defined.
Consequently, when doing
$link = mysqli_connect('127.0.0.1', 'user', 'secret', 'test');
$result = mysql_query("SELECT 'it works' FROM dual", $link);
you will get
Warning: mysql_query() expects parameter 2 to be resource, object given
and $result
will be NULL
.