xyn Posted August 6, 2006 Share Posted August 6, 2006 Hey,I have got hese four errors I don't know how to fix them.[color=purple]Warning: mysql_query(): Access denied for user 'nobody'@'localhost' (using password: NO) in en/includes/tools.php on line 4Warning: mysql_query(): A link to the server could not be established in en/includes/tools.php on line 4Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in en/includes/tools.php on line 5[/color]tools.phpLine 4:$sql = mysql_query("SELECT usr_rank FROM accounts WHERE usr_user='{$_SESSION['user']['usr_user']}'");Line 5 & 6:while( $data = mysql_fetch_array($sql)) {entire code:[code=php:0]<?PHP include("config.php"); include("".$INFO['SITE_URL']."/en/db/db.php"); $sql = mysql_query("SELECT usr_rank FROM accounts WHERE usr_user='{$_SESSION['user']['usr_user']}'"); while( $data = mysql_fetch_array($sql)) { $rank = $data[0]; }if($_SESSION['EumodUK'] != true) { //tool is not set. exit; } else { if( $rank == "admin" ) { $tools = 'tools'; exit; } elseif( $rank == "mod" ) { $tools = 'tools here'; exit; } else { $login=''; exit; } }?>[/code] Quote Link to comment Share on other sites More sharing options...
Orio Posted August 6, 2006 Share Posted August 6, 2006 There seems to be a problem with the connection. Are you sure about the user and pass?Orio. Quote Link to comment Share on other sites More sharing options...
xyn Posted August 6, 2006 Author Share Posted August 6, 2006 Yeah, I used that same db.php file and directory for the registering and logging in etc. works fine...basically I have a folder called en,includes/ = dir.db/ = direzone/ = dirand I have used include from ezone/pages.php => ../db/db.php works fine...just that one doesn't :/ Quote Link to comment Share on other sites More sharing options...
maxic0 Posted August 6, 2006 Share Posted August 6, 2006 Yes like Orio said, these errors are just because you can't connect to your database. Its nothing to do with your code. Quote Link to comment Share on other sites More sharing options...
xyn Posted August 6, 2006 Author Share Posted August 6, 2006 I can see that, but my db.php ie connection is fine! :/ Quote Link to comment Share on other sites More sharing options...
xyn Posted August 6, 2006 Author Share Posted August 6, 2006 also if i change the include to ../db/db.php i get:Warning: main(../db/db.php): failed to open stream: No such file or directory in /en/includes/tools.php on line 3Warning: main(): Failed opening '../db/db.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /en/includes/tools.php on line 3Warning: mysql_query(): Access denied for user 'nobody'@'localhost' (using password: NO) in /en/includes/tools.php on line 4Warning: mysql_query(): A link to the server could not be established in en/includes/tools.php on line 4Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /en/includes/tools.php on line 5 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.