<html>
<head>
<title>blabla</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#000000" text="#CCCCCC" link="#CCCCCC" vlink="#CCCCCC" alink="#CCCCCC" leftmargin=0 rightmargin=0 bottommargin=0 topmargin=0>
<?php
require("global.php");
print("<table><tr><td colspan=\"2\">Top Posters</td></tr>
<tr><td><b>Username</b></td><td><b>Posts</b></td></tr>");
$db_link = @mysql_pconnect("$dbservername", "$dbusername", "$dbpassword");
mysql_select_db ("$dbname", $db_link)
or die("Error connecting to DB");
$query = mysql_query("SELECT posts, username FROM user ORDER BY user.posts DESC, user.username DESC LIMIT 0, 10")
or die("Query Error:$query");
while($row = mysql_fetch_array($query))
{
$username = $row["username"];
$posts = $row["posts"];
print("<tr><td>$username</td><td>$posts</td></tr>");
}
print("</table>");
?>
that's the script I use ,and this is the error I get :
Warning: Supplied argument is not a valid MySQL-Link resource in /web/sites/3/blabla111111/www.blabla.f2s.com/board/main.php on line 15
Error connecting to DB
|