Interview Question in SQL Server 2005 Driver for PHP


 

Interview Question :: Can you use Php with SQL server 2005? If so, can some one explain it or give links to tuts on how to do it


Yes; you work with it virtually the same way you work with MySQL server and the like. PHP has built-in MSSQL functions, just like it has built-in MySQL functions.

$link = mssql_pconnect( 'host', 'user', 'pass' ) or die( 'Cannot connect') ;
mssql_select_db( 'dbname' ) or die( 'Cannot select db' );

$query = "SELECT * FROM table";

$rs = mssql_query( $query ) or die( 'Cannot run query' );

while( $row = mssql_fetch_array( $rs ) ) {
echo $row['column']."
";
}
Answers to "Can you use Php with SQL server 2005? If so, can some one explain it or give links to tuts on how to do it"
RE: Can you use Php with SQL server 2005? If so, can some one explain it or give links to tuts on how to do it?

http://pear.php.net/
 
Vote for this answer ::  
RE: Can you use Php with SQL server 2005? If so, can some one explain it or give links to tuts on how to do it?

http://builder.com.com/5100-6371-5160904...



allthough this tut is for sql server 200, it will be pretty much the same basics.



you can use any database you can think of, if you are using odbc
 
Vote for this answer ::  
Update Alert Setting