doramail05
asked on
trusted connection to sql server 2008 from php
below is the code for sql authenticaion connection string
how about for trusted connection to sql server
how about for trusted connection to sql server
<?php
session_start();
if ($_SERVER['REQUEST_METHOD']=='POST'){
$myServer = "localhost";
$myUser = "sa";
$myPass = "#$";
$myDB = "db01";
//connection to the database
$dbhandle = mssql_connect($myServer, $myUser, $myPass)
or die("Couldn't connect to SQL Server on $myServer");
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hai,
just search for the below one's online,you will find the easy way of doing this
1) $conn = odbc_connect('myDSN','','' );
2) $query = "select * from cars";
//perform the query
$result=odbc_exec($conn, $query);
3) $colName = odbc_num_fields($result);
Just look for this link,
http://www.webcheatsheet.com/PHP/connect_mssql_database.php
just search for the below one's online,you will find the easy way of doing this
1) $conn = odbc_connect('myDSN','',''
2) $query = "select * from cars";
//perform the query
$result=odbc_exec($conn, $query);
3) $colName = odbc_num_fields($result);
Just look for this link,
http://www.webcheatsheet.com/PHP/connect_mssql_database.php
if you want to use Windows Authentication with PHP, its good to know some important stuff about it
http://blogs.msdn.com/b/brian_swan/archive/2010/02/10/sql-server-driver-for-php-understanding-windows-authentication.aspx