Re: PHP and SQL 2000
| From: | Nathan | Date: | Thu, 12 Aug 2004 11:46:40 +0000 |
| Subject: | Re: PHP and SQL 2000 | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-24391@lists.php.net to get a copy of this message | ||
Php mysql schreef:
But when i try to connect to the database using the mssql_xxxx functions like: <?php $dsn = "btc"; $user = "";$user = "";
$password = ""; $myDB = "BACSDB_test"; $sqlconnect = mssql_connect ("$localhost", $user, $password); $sqldb = mssql_select_db($myDB, $sqlconnect) or die("Couldn't open database $myDB"); $sqlquery = "SELECT FullDescrp FROM BTCCode3;"; $result = mssql_query ($sqlquery); echo $sqlquery; echo "<br><br>"; while ($row = mssql_fetch_array ($result)) { echo $row['FullDescrp']."<br>\n"; } mssql_close ($sqlconnect); ?>
It is not getting conencted. The following error is given: "Warning: mssql_connect(): message: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. (severity 14) in c:\program files\apache group\apache\htdocs\btc_test.php on line 8 Login failed for user '(null)'
Warning: mssql_connect(): Unable to connect to server: in c:\program files\apache group\apache\htdocs\btc_test.php on line 8 Warning: mssql_select_db(): supplied argument is not a valid MS SQL-Link resource in c:\program files\apache group\apache\htdocs\btc_test.php on line 9 Couldn't open database BACSDB_test"