Assalamu'alaikum,wr,wb.
Kali ini saya akan share bagaimana caranya koneksi php ke sql server.
Berikut ini syntaxnya.
_________________________________________________________________________________
<?php
$myServer = "10.10.39.10";
$myUser = "sa";
$myPass = "";
$myDB = "medan2013";
//connection to the database
$dbhandle = mssql_connect($myServer, $myUser, $myPass)
or die("Couldn't connect to SQL Server on $myServer");
//select a database to work with
$selected = mssql_select_db($myDB, $dbhandle) or die("Couldn't open database $myDB");
//close the connection
mssql_close($dbhandle);
?>
_________________________________________________________________________________
Semoga bermanfaat.
http://pangeran-it.blogspot.com/
Kali ini saya akan share bagaimana caranya koneksi php ke sql server.
Berikut ini syntaxnya.
_________________________________________________________________________________
<?php
$myServer = "10.10.39.10";
$myUser = "sa";
$myPass = "";
$myDB = "medan2013";
//connection to the database
$dbhandle = mssql_connect($myServer, $myUser, $myPass)
or die("Couldn't connect to SQL Server on $myServer");
//select a database to work with
$selected = mssql_select_db($myDB, $dbhandle) or die("Couldn't open database $myDB");
//close the connection
mssql_close($dbhandle);
?>
_________________________________________________________________________________
Semoga bermanfaat.
http://pangeran-it.blogspot.com/
Koneksi PHP ke MSSQL (SQL Server)
Reviewed by Syawaluddin Amin, S.Kom
on
Agustus 02, 2013
Rating:
Tidak ada komentar: