Page 1 of 1

establishe a connection with the MySql database

Posted: Thu Dec 04, 2008 12:46 am
by Tassadduq
i want to establish a connection with the MySql database.

here is my code


<?php

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

$images_dir = 'photos';

?>



whats wrong

Re: establishe a connection with the MySql database

Posted: Thu Dec 04, 2008 5:04 am
by pbs
Can you please try some other database name instead of mysql. Also have you created username and password "root" on localhost.

If possible let me know what error you are getting.

Re: establishe a connection with the MySql database

Posted: Thu Dec 04, 2008 11:04 am
by Tassadduq
i am just trying to create a php photo galley using mysql.
for this purpose i am trying to follow the steps that's are given in the following link.


http://www.sitepoint.com/article/php-ga ... m-minutes/

is any one have the simple tutorial to make a php picture gallery with only few pictures.