Jump to content


Photo

4 Errors :/


  • Please log in to reply
5 replies to this topic

#1 xyn

xyn
  • Members
  • PipPipPip
  • Advanced Member
  • 779 posts
  • LocationNorthampton

Posted 06 August 2006 - 02:43 PM

Hey,
I have got hese four errors I don't know how to fix them.

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


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:
<?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;
			}
		
		}

?>


#2 Orio

Orio
  • Staff Alumni
  • Advanced Member
  • 2,491 posts

Posted 06 August 2006 - 02:46 PM

There seems to be a problem with the connection. Are you sure about the user and pass?

Orio.
Think you're smarty?

(Gone until 20 to November)

#3 xyn

xyn
  • Members
  • PipPipPip
  • Advanced Member
  • 779 posts
  • LocationNorthampton

Posted 06 August 2006 - 02:48 PM

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 :/

#4 maxic0

maxic0
  • Members
  • PipPipPip
  • Advanced Member
  • 70 posts

Posted 06 August 2006 - 02:50 PM

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

#5 xyn

xyn
  • Members
  • PipPipPip
  • Advanced Member
  • 779 posts
  • LocationNorthampton

Posted 06 August 2006 - 02:53 PM

I can see that, but my db.php ie connection is fine! :/

#6 xyn

xyn
  • Members
  • PipPipPip
  • Advanced Member
  • 779 posts
  • LocationNorthampton

Posted 06 August 2006 - 03:00 PM

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





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users