Last active
January 18, 2016 02:04
-
-
Save whaone79/e99f28ccc9a8226f000c to your computer and use it in GitHub Desktop.
Mengkoneksikan PHP ke Microsoft SQL Server di Linux menggunakan FreeTDS, silahkan lihat di : http://w4w417.wordpress.com/2016/01/14/mengkoneksikan-php-ke-microsoft-sql-server-di-linux-menggunakan-freetds/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$db['default']['hostname'] = "sqlserver"; | |
$db['default']['username'] = "sa"; | |
$db['default']['password'] = "Server123"; | |
$db['default']['database'] = "Asset_Mgr"; | |
$db['default']['dbdriver'] = "mssql"; | |
$db['default']['dbprefix'] = ""; | |
$db['default']['pconnect'] = TRUE; | |
$db['default']['db_debug'] = FALSE; | |
$db['default']['cache_on'] = FALSE; | |
$db['default']['cachedir'] = ""; | |
$db['default']['char_set'] = "utf8"; | |
$db['default']['dbcollat'] = "utf8_general_ci"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$link = mssql_connect('sqlserver', 'sa', 'Server123'); | |
if (!$link) | |
die('Unable to connect!'); | |
else echo 'Connected to sqlserver<br>'; | |
if (!mssql_select_db('Asset_Mgr', $link)) | |
die('Unable to select database!'); | |
else echo 'DB Asset_mgr is selected<br>'; | |
$result = mssql_query('SELECT * FROM modules'); | |
echo 'module list :<br>'; | |
while ($row = mssql_fetch_array($result)) { | |
echo($row['module_id'] .'<br>'); | |
} | |
mssql_free_result($result); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment