|
<?php
$connid=@mysql_connect("localhost","","");
$sql="select * from user_info";
$result=mysql_db_query("user",$sql);
$name=mysql_result($result,0,"username");
$sex=mysql_result($result,0,"sex");
$email=mysql_result($result,0,"Email");
?>
<html>
<head>
<title>信息</title>
</head>
<body>
<table>
<tr>
<td>用户名:</td>
<td>
<?php
echo $name;
?></td>
<tr>
<td>性 别</td>
<td>
<?php
echo $sex;
?></td>
<tr>
<td>Email</td>
<td>
<?php
echo $email;
?></td>
</tr>
</table>
浏览效果,出现错误信息:
Warning: mysql_db_query() [function.mysql-db-query]: Access denied for user 'www-data'@'localhost' (using password: NO) in /var/www/show.php on line 4
Warning: mysql_db_query() [function.mysql-db-query]: A link to the server could not be established in /var/www/show.php on line 4
Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /var/www/show.php on line 5
Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /var/www/show.php on line 6
Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /var/www/show.php on line 7
用户名:
性 别
Email
请大家帮帮忙!哪里出错了!! |
|