Want to thank everyone for there comments. I was able to get it connected. Now it looks as if I have some syntax errors to work out. No biggy though. Again, thanks for all your help.
----- Original Message ----- From: "Frank M. Kromann" <[EMAIL PROTECTED]> To: "Micah Montoy" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Monday, June 30, 2003 12:31 AM Subject: Re: [PHP-WIN] authenticating with SQL Server 2000 > Hi, > > If you remove the @ in front of the mssql_* functions you might get a bit > more information about the problem. > > Using the MSSQL Server extension requires these stapes: > > 1) Install the SQL Server Client tools on the maschine running PHP (if > your are using Win32) > 2) Configure a server alias using the client network utility. The alias > specifies name, host name, protocol and port numbers used for the db > communication. > 3) Connect to the database using the alias as db name as first parameter > in mssql_connect. > 4) If the SQL Server is configured for trusted connections only, enable > this in PHP.INI by setting mssql.secure_connection = On (no need for > userid and password then) > > If you are connection from a *nix box. You need to compile and install > FreeTDS and recompile php using the --with-mssql configure option. > > There is no need to create any ODBC configurations to use the mssql_* > functions > > - Frank > > > 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 > > > > > > > > -- > > PHP Windows Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php