Home >Backend Development >PHP Tutorial >PHP connection to mysql, oracle, mssql database connection code_PHP tutorial
php connection mysql, oracle, mssql database connection code
php tutorial connection mysql tutorial, oracle, mssql database tutorial connection code
//mssql
$server='hbds3';
$username='username';
$password='pwd';
$database='database';
$conn=mssql_connect($server,$username,$password)
or die("couldn't connect to sql server on $server");
$db=mssql_select_db($database) or die("couldn't open database $database");
//oracle
$conn = oci_connect("databasename","passwd","sid");
if (!$conn) {
$e = oci_error();
trigger_error(htmlentities($e['message'], ent_quotes), e_user_error);
}
//mysql
$conn=mysql_connect("localhost","root","admin") or die("Database server connection error".mysql_error());
Mysql_select_db("admin",$conn) or die("Database access error".mysql_error());
Mysql_query("set names gb2312");