Connect with mysql database

Connect with mysql database

This is a tutorial to connect with mysql database using php.Follow the steps below to do this.I used wamp here as local server.


1.Open your browser and type "http://localhost/phpmyadmin/" to open phpmyadmin interface.
2. Click on database and then write your database name (e.g. "test") in the box.


3. Click create.
4.Create a file into www folder of wamp in c drive name test.php
5.Write the following code in test.php

<?php
$c=mysql_connect('localhost','root','');
if($c) echo 'conneted'; else echo 'not connected';
?>

6.Now type this "http://localhost/test.php/" in your web-browser URL bar.
7.If you see "connected" then your database is connected else you'll see not connected.
8. That's all .Chat on CBOX for futher information

1 Response to "Connect with mysql database"

Unknown said...

nice

Post a Comment

leave a comment