时间:2021-07-01 10:21:17 帮助过:26人阅读
你用的是微软Microsoft SQL却用mysqli去连接能连接上就见鬼了
mssql_connect
小弟刚学php,很多都不懂的。麻烦大神再帮我看看,我改了之后还是错。
$dbc = mysql_connect('localhost','tom', '123123', 'aliendatabase')
or die('Error connecting to MySQL server.');
$query = "INSERT INTO aliens_abduction (first_name, last_name, when_it_happened, how_long, " .
"how_many, alien_description, what_they_did, fang_spotted, other, email) " .
"VALUES ('$first_name', '$last_name', '$when_it_happened', '$how_long', '$how_many', " .
"'$alien_description', '$what_they_did', '$fang_spotted', '$other', '$email')";
$result = mysql_query($dbc, $query)
or die('Error querying database.');
mysql_close($dbc);
Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'localhost' (10061) in E:\Learing\phpWeb\aliens\report.php on line 22
Error connecting to MySQL server.