Re: authenticating with SQL Server 2000
| From: | Luis Ferro | Date: | Sun, 29 Jun 2003 20:39:35 +0000 |
| Subject: | Re: authenticating with SQL Server 2000 | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-20616@lists.php.net to get a copy of this message | ||
Do you have the mssql_*.dll uncommented from php.ini?
And the extension directory correctly set-up to the directory where that dll is inside the php directory?
LF
Micah Montoy wrote:
I'm in the process of learning PHP. I've gotten to the point of having problems with accessing a database. What is happening is that I am getting the message "Couldn't connect to SQL Server on BOBOS" (the name of the server). I've tried putting in a user but with the same results. Now, I'm wondering if there is some setting in the php.ini file that I missed. I specified in the php.ini file to use the sql server extension and it compiles without error. Here is the code. <?php $myServer = "BOBOS"; $myUser = "Bobo the Bugbear"; $myPass = ""; //password not required $myDB = "picture_DB"; $server = @mssql_connect($myServer, $myUser, $myPass) or die("Couldn't connect to SQL Server on $myServer"); $database = @mssql_select_db($myDB) or die("Couldn't open database $myDB"); $result = mssql_query("SELECT * FROM category",$database); printf ("Category: %s<br>n", mssql_result($result,0,"name")); while($row = mssql_fetch_row($result)) { echo "<li>" . $row[0] . "</li>"; } ?> What might I be missing? I already specified the database in the ODBC connection part of windows. Wasn't sure if this was needed or not but did it anyway. Anyway, if you could send me a note on what it is I might be missing, I would greatly appreciate it. thanks