establishe a connection with the MySql database

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
Tassadduq
Forum Commoner
Posts: 60
Joined: Wed Dec 03, 2008 2:53 pm

establishe a connection with the MySql database

Post 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
pbs
Forum Contributor
Posts: 230
Joined: Fri Nov 07, 2008 5:31 am
Location: Nashik, India
Contact:

Re: establishe a connection with the MySql database

Post 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.
User avatar
Tassadduq
Forum Commoner
Posts: 60
Joined: Wed Dec 03, 2008 2:53 pm

Re: establishe a connection with the MySql database

Post 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.
Post Reply