Thread: Php & mssql

View Single Post

  #8 (permalink)  
Old 01-12-2008, 06:45 PM
Solonox Solonox is offline
Coder
 
Join Date: Feb 2008
Posts: 45
Nominated 1 Time in 1 Post
Nominated TOTW/F/M Award(s): 1
Thanks: 0
Thanked 0 Times in 0 Posts
Solonox is on a distinguished road
Default

haha... no i don't think so.

Can you try this example

try {
$hostname = "
ADMIN\SQLEXPRESS";
$dbname = "testdb";
$username = "sa";
$pw = "adm1n";

$dbh = new PDO ("mssql:host=$hostname;dbname=$dbname","$username" ,"$pw");
} catch (PDOException $e) {
echo "Connection failed because: " . $e->getMessage() . "\n";
exit;
}


That should write out your exception.. However someone of the PHP guys here may have a better way of doing it.. but that should work
__________________
Web Design Ireland - CDG Web Design
Reply With Quote