Home > Backend Development > PHP Tutorial > PHP connection to mysql, oracle, mssql database connection code_PHP tutorial

PHP connection to mysql, oracle, mssql database connection code_PHP tutorial

WBOY
Release: 2016-07-13 17:04:43
Original
1152 people have browsed it

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");

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/630843.htmlTechArticlephp 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'; $...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template