PHP MySQL question

i’m trying to follow this tutorial to build a Php and MySql image gallery but am running into a few problems as i’m not very advanced with php.

tutorial is here http://www.sitepoint.com/article/php-gallery-system-minutes

I have set up the database in PHP MyAdmin using the WAMP server. I have also downloaded the files that i need for the tutorial and am editing them as I go.

I am on Pg 1 of the tutorial, and having exported my database - i called it ‘gallery’ i saved it as a .txt file and have put it in the www directory of the WAMP server along with the other php files.

Problem is I can’t seem to connect to the database even though i have changed the name of the database to gallery.

when i run the page on the localhost i get the following error messages


Warning:  mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: YES) in C:\wamp\www\config.inc.php on line 4

Warning:  mysql_select_db() [function.mysql-select-db]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\wamp\www\config.inc.php on line 5

Warning:  mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in C:\wamp\www\config.inc.php on line 5
Could not select database

So I am assuming it is something to do with the user and password.

Here is my code here -

<?php
    // Before implementing this code, you should use your own username, password and database name values.

    $mysql_link = mysql_connect("localhost", "root", "root");   
     mysql_select_db("gallery") or die("Could not select database");

    $images_dir = "photos";
?>

can anyone help? I’m sort of on a tight deadline for to do this.

thanks in advance :nerd: