Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Connect php with sqlserver
Message
From
14/10/2016 03:01:25
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Connect php with sqlserver
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows 7
Network:
Windows XP
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01641931
Message ID:
01641931
Views:
39
Sir,

I am using wamp 3.0 having php 5.6.15
SQLSERVER 2008 is installed on Windows 7 32bit.

I want to connect sqlserver with php, So I put required drives in Bin folder as

attached image aa

and made some necessary changes in php.ini as

attached image bb

Finally I have this connection string
<?php
$host="SERVER";
$username="sa";
$password="123456";
$db_name="at17"; 
$con=sqlsrv_connect($host, $username, $password,$db_name);

if(!$con){
die ('<script type="text/javascript">alert("Error Connecting to host")'. mysqli_connect_error($con).'</script>'); 
}
else
{
//echo( '<script type="text/javascript">alert("Connected")</script>');
}
?>
But it displays this error message

attached image cc-png

What I am doing wrong?

Please help me
Reply
Map
View

Click here to load this message in the networking platform