Jump to content

Archived

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

xyn

4 Errors :/

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]

Share this post


Link to post
Share on other sites
There seems to be a problem with the connection. Are you sure about the user and pass?

Orio.

Share this post


Link to post
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 :/

Share this post


Link to post
Share on other sites
Yes like Orio said, these errors are just because you can't connect to your database. Its nothing to do with your code.

Share this post


Link to post
Share on other sites
I can see that, but my db.php ie connection is fine! :/

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

×

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.