Page 1 of 1

Few errors?

PostPosted: 16. November 2009 10:41
by jimlad
Hi there,

I have XAMMP v1.7.2 for Windows running on a Windows XP SP2 box ... Now typically, I've been running my php script from online webhosts, but want to try get it working locally.

When viewing the page, I am presented with the following errors:

Code: Select all
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\xampp\htdocs\class.Mysql.php on line 18

Fatal error: Call to undefined function error() in C:\xampp\htdocs\class.Mysql.php on line 101


So, I have no user called ODBC what so ever ... here is the few lines from that file:

Code: Select all
      

17  global $config;
18  $this->rLink = mysql_connect( $config[ "host" ], $config[ "username" ], $config[ "password" ] );
19  if( !$this->rLink )
20  {
21  $this->triggerError( "Could not make connection with <i>" . $config[ "host" ] . "</i>." );


Now my db, user, and password is pulled from config.php which reads:

Code: Select all
<?

$config[ "username" ] = "xxx";
$config[ "password" ] = "xxx";
$config[ "host" ] = "localhost";
$config[ "database" ] = "xxxx";
?>



Any ideas?

Re: Few errors?

PostPosted: 16. November 2009 10:49
by Izzy
Did you create your database/user/password using phpMyAdmin?

See if there is any help in the Forum Search Results.

Re: Few errors?

PostPosted: 16. November 2009 11:13
by Wiedmann
Code: Select all
Access denied for user 'ODBC'@'localhost'

Now my db, user, and password is pulled from config.php which reads:

Your script is not using this user "xxx" from this "config.php".

Re: Few errors?

PostPosted: 16. November 2009 12:50
by jimlad
Is this because its using PHP4 and not 5?

The username/password combo is correct in phpMyAdmin, i aint that bad :lol:

Anyway around this?

Re: Few errors?

PostPosted: 16. November 2009 13:22
by Nobbie
Use <?php instead of <?

Re: Few errors?

PostPosted: 16. November 2009 13:59
by jimlad
Doesn't make a difference, thanks for the input though

Anyone else?

Re: Few errors?

PostPosted: 17. November 2009 09:14
by Altrea
- display all errors (inclusive Notices) if not done before
- Try to echo out (or better var_dump) your $config array after setting the array values and second time earlier then your db_connect on line 18.