search
top

MS SQL with PHP

Below is the simple PHP (>= 7.0.0) script to connect with the MS SQL database <?php try { $hostname = ""; //host name $port = 1433; //port number $dbname = ""; //database name $username = ""; //database username $pw = ""; //database password $dbh = new PDO ("dblib:host=$hostname:$port;dbname=$dbname","$username","$pw"); ...
read more

MS SQL with Magento

Here is a way to connect mssql database using Magento’s inbuilt models. <?php include_once 'app/Mage.php'; Mage::app(); $host = '';//in the format 127.0.0.1:1433 , 1433 is the default port number $user = ''; // DB user name $pass = ''; // DB password $dbname = ''; //DB name $db = new Zend_Db_Adapter_Pdo_Mssql(array( 'host' => $host, 'username' => $user, ...
read more

top