不推荐使用mysql函数? [重复]

I have changed my code to cater the new functions of MySQLi. Here is a snippet of my code:

From:

mysqli_query("SELECT user_type FROM user");

To:

mysqli_query("SELECT user_type FROM user");

Although this now does not work, what else would I need to change?

</div>

There are two main options:

The latter lends itself better to OOP techniques.

Change it to mysqli_query("SELECT user_type FROM user");

or, if you want object oriented

$mysqli = new mysqli('localhost', 'root', 'pass', 'db');
$mysqli->query("SELECT user_type FROM USER")