我读过不止一次,这比使用mysqli和mysql更好。
我想知道:
$con = @mysql_connect ("localhost", "username", "pass");
if(!$con)
exit("Unable to connect to the Database server");
$db2 = @mysql_select_db("DB_NAME");
if(!$db2)
exit("Unable to connect to the Database");
$query = mysql_query("SELECT somme_filed FROM some_table");
while ($index= mysql_fetch_array($query ))
{
....
}
发布于 2018-05-27 06:36:55
1.只要只安装了一个php实例,就不会有任何问题,但是如果您有多个实例,则可能需要手动将其指向您希望使用的版本。How do I activate mysqli with wampserver?
2.您可以通过这样的操作使用mysqli进行连接
$con = mysqli_connect("localhost","my_user","my_password","my_db");
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
3.MYSQL已不再开发,已被视为已被废弃。Why shouldn't I use MYSQL functions
https://stackoverflow.com/questions/50549589
复制相似问题