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.
1 Response to "Connect with mysql database"
nice
Post a Comment
leave a comment