Fri, 17 May 2024


How to connect to MS SQL Server with PHP and execute sql queries?

By: Peter, NetArt Media
Tue, 3 November 2020

The FreeTDS library provides rich functionality for working with MS SQL Server databases.
This library makes the work with MS SQL Server databases such easier as with every MySQL database.

<?php
---
$num= mssql_connect($sqlserver , $sqluser , $sqlpass );
echo ("ConnectID: $numero<br>n");
...
$result=mssql_query('select * from table',$num );
...
mssql_close($num);
---
?>

The FreeTDS could be downloaded from this address: http://www.freetds.org/


Category: PHP Examples
Share this post:



See All Scripts






Subscribe for our newsletter

Receive the latest blog posts direct in your mailbox