You cannot execute multiple queries with mysql_query()
You should use mysqli_multi_query to do this. There is no equivalent of mysqli_multi_query
in mysql_*
functions.
You can use both mysql_*
and mysqli_*
in the same code but be careful not to mix them up like open with mysql_open() and query with mysqli_query() and vice versa. Once the connection is opened with mysqli_open()
you should use only mysqli_*
functions on that connection. This applies for mysql_*
connection also. But you can have both connections open at the same time from the same code.
Warning: mysql_
function is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQL extension should be used.