Jump to content

Mysql connection problem


HaZaRd420

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.
Link to comment
https://forums.phpfreaks.com/topic/4028-mysql-connection-problem/
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.