PHP-MySQL连接错误

Muh*_*ain 0 php mysql

我试图通过以下代码通过PHP连接到MySQL

<?php

$dbhost = 'localhost';
$dbuser = 'root';
$pass   = 'pass';


 $con = mysql_connect($dbhost,$dbuser,$pass);
 if (!$con)
   {
   die('Could not connect: ' . mysql_error());
   }

 mysql_select_db("test", $con);

 mysql_query("UPDATE cbdb SET fax = '36160'
 WHERE cemail = 'test_cemail@gmail.com' AND cbref = 'test_cbref'");

 mysql_close($con);
 ?>
Run Code Online (Sandbox Code Playgroud)

但即使显示MySQL连接错误,也会显示错误.

jus*_*inl 5

你在'通过'后错过了半结肠吗?