Jump to content


HELP ME, pls! It's problem of a simple PHP


5 replies to this topic

#1 Bear.IQ200

    Young Padawan

  • Members
  • Pip
  • 15 posts

Posted 12 December 2006 - 11:23 AM

Warning: mysql_query(): Access denied for user: 'apache@localhost' (Using password: NO) in /home/cgfxclub/domains/cgfxclub.com/public_html/news/read.php on line 6

Warning: mysql_query(): A link to the server could not be established in /home/cgfxclub/domains/cgfxclub.com/public_html/news/read.php on line 6

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/cgfxclub/domains/cgfxclub.com/public_html/news/read.php on line 8

Warning: mysql_close(): no MySQL-Link resource supplied in /home/cgfxclub/domains/cgfxclub.com/public_html/news/read.php on line 20

It show that and my code is :

<?
include "http://www.cgfxclub.com/config.inc.php";
$id=$_GET['id'];

$sql = "SELECT * FROM news WHERE id='$id'";
$result = mysql_query($sql);

while ($rows = mysql_fetch_array($result)) {
?>
<table border=90% border=0 bgcolor=#E0E0E0>
<tr>
<td><center><?=$rows[titile]; ?></center></td>
</tr>
<tr>
<td><center><?=$rows[text]; ?></center></td>
</tr>
</table>
<?
}
mysql_close();
?>


help me plss

#2 meadow

    Young Padawan

  • Members
  • Pip
  • 224 posts
  • Location:Devon, England
  • Interests:Php, Hockey, mysql, web design.

Posted 12 December 2006 - 11:28 AM

Some of your mysql connection details are wrong, show us your config.inc.php file (star any passwords etc).

#3 Bear.IQ200

    Young Padawan

  • Members
  • Pip
  • 15 posts

Posted 12 December 2006 - 11:31 AM

http://www.cgfxclub.com

Can you enter this, I used news.inc.php for order a list of news, used same file (config.inc.php)

#4 meadow

    Young Padawan

  • Members
  • Pip
  • 224 posts
  • Location:Devon, England
  • Interests:Php, Hockey, mysql, web design.

Posted 12 December 2006 - 11:38 AM

What is the code for the http://www.cgfxclub.com/config.inc.php file?, it must have a mysql_connect() function.

Edited by meadow, 12 December 2006 - 11:46 AM.


#5 Bear.IQ200

    Young Padawan

  • Members
  • Pip
  • 15 posts

Posted 12 December 2006 - 11:47 AM

I mean news.inc.php <-- can order a list of news by included config.inc.php

but

read.php <-- include config.inc.php too but cannot show

#6 Hayden

    P2L Jedi

  • Members
  • PipPipPip
  • 716 posts
  • Gender:Male
  • Location:Texas

Posted 12 December 2006 - 12:20 PM

Warning: mysql_query(): Access denied for user: 'apache@localhost' (Using password: NO) in /home/cgfxclub/domains/cgfxclub.com/public_html/news/read.php on line 6

most if not all your problems you're asking about will be cleared up there.

the username and/or password is not being sent correctly to the mySQL server.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users