Jump to content

Archived

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

HaZaRd420

Mysql connection problem

Recommended Posts

Hello, im having this problem with my mysql not connecting to my DB:

Warning: mysql_connect(): Access denied for user: 'MYDB@localhost' (Using password: YES) in /home/gtqsqua/public_html/roster/members.php on line 9
Access denied for user: MYDB@localhost' (Using password: YES)

And heres the members.php

[code]<?php
//PHP NEWS v0.1 BY HaZaRd//
include('config.php');

$connection = mysql_connect( "$host","$user","$pass" ) or die(mysql_error());

$rs = mysql_select_db( "$db" );

$sql=" select * from news order by date $sort ";

$rs = mysql_query($sql) or die(mysql_error());

echo '


';
while ( $row = mysql_fetch_array( $rs) )
{
echo '
<font face="verdana" size=1>
<b>Subject:</b> '.$row["subject"].' &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<b>Author:</b><i> '.$row["author"].' </i> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<b>Date:</b> '.$row["date"].'<br><br>
'.$row["content"].'<br>
<hr color="#000000">
';
}
?>
[/code]

Please Help me on this, I cant figure out what the problem is.

Share this post


Link to post
Share on other sites
also, please try this:

change
[code]
$connection = mysql_connect( "$host","$user","$pass" ) or die(mysql_error());
[/code]

to
[code]
$connection = mysql_connect( $host, $user, $pass ) or die(mysql_error());
[/code]

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.