or die('error connecting to mysql server.');
也分离了数据库一个mdf和一个ldf文件放在同一个文件夹中。
但是测试时还是出错,好像是无法连接sql服务器位置:
warning: mysqli_connect() [function.mysqli-connect]: (hy000/2003): can't connect to mysql server on 'localhost' (10061) in e:\learing\phpweb\aliens\report.php on line 22
error connecting to mysql server.
我用的是microsoft sql server 2005,我的sql是连接服务器的了,用户名和密码也没有错。求解。
回复讨论(解决方案) 你用的是微软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.
