Jump to content

4 Errors :/


xyn

Recommended Posts

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 4

Warning: mysql_query(): A link to the server could not be established in en/includes/tools.php on line 4

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in en/includes/tools.php on line 5[/color]

tools.php

Line 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]
Link to comment
https://forums.phpfreaks.com/topic/16709-4-errors/
Share on other sites

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/ = dir
ezone/ = dir
and I have used include from ezone/pages.php => ../db/db.php works fine...
just that one doesn't :/
Link to comment
https://forums.phpfreaks.com/topic/16709-4-errors/#findComment-70221
Share on other sites

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 3

Warning: main(): Failed opening '../db/db.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /en/includes/tools.php on line 3

Warning: mysql_query(): Access denied for user 'nobody'@'localhost' (using password: NO) in /en/includes/tools.php on line 4

Warning: mysql_query(): A link to the server could not be established in en/includes/tools.php on line 4

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /en/includes/tools.php on line 5
Link to comment
https://forums.phpfreaks.com/topic/16709-4-errors/#findComment-70232
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.