Skip to main content

Posts

Php database connection using mysql

<?php
// localhost connection
        $connection=mysql_connect("localhost","root","") or die("server not found");
        $connect=mysql_select_db("databasename",$connection) or die("db not found");

// server connection
        $connection=mysql_connect("serverhost(e.g 123.12.12.12)","username","password") or die("server not found");
        $connect=mysql_select_db("databasename",$connection) or die("db not found");

?>

Google News - Top Stories

Recent posts

About Me

My Self Akash Sathvara. Lives in Ahmedabad,Gujarat. I have done my Education in 2012. and completed my Degree(B.E.I.T) from GTU(Gujarat Technological University).
My SKILLS in Website :
Asp.netC#PHPHTMLCSSJavascript