刚学PHP,按照孙仲岳老师的视频写了这个计数器的代码,如下:
<?
//-----[基本设定]-----
$mysql_server_name = "localhost"; //主机
$mysql_username = "root"; //帐号
$mysql_password = "123456"; //密码
$mysql_database = "andy"; //数据库
//-------
//建立连接---透过(伺服器位址、使用者名称、使用者密码)
$conn=mysql_connect($mysql_server_name,$ysql_username,$mysql_password);
//准备好你的SQL语法
$sql ="INSERT INTO 'andy'.'conuter' ('new')VALUES ('1')";
//选取你要处理的数据库
mysql_select_db($mysql_database,$conn);
//进行查询(或叫做执行)
$result = mysql_query($sql);
//结束并且释放连接
mysql_close($conn);
?>
可出现如下的错误:
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'ODBC'@'localhost' (using password: YES) in D:\www\blue.php on line 12
Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in D:\www\blue.php on line 18
Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in D:\www\blue.php on line 21
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in D:\www\blue.php on line 21
Warning: mysql_close(): supplied argument is not a valid MySQL-Link resource in D:\www\blue.php on line 24
希望有朋友指点下,百度搜了很久没找到答案,中文手册又找不到,才不得已麻烦你们
[此贴子已经被作者于2007-4-25 11:44:12编辑过]