RE: [PHP] Help SQLServer connection: What's "server_name"??
| From: | Fernando Verdu Castillo | Date: | Fri, 13 Aug 2004 09:49:06 +0000 |
| Subject: | RE: [PHP] Help SQLServer connection: What's "server_name"?? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-193677@lists.php.net to get a copy of this message | ||
> [snip]
> Hi all, that's my first question here, I'm not subscribed.
>
> I'm tring to connect a local DB (Apache+sqlserver2K), but when I execute
> this
> simple example:
>
> <?php
> $conectID = mssql_connect(????,"SA","");
> mssql_select_db("Northwind");
> $result=mssql_query("select * from products",$numero );
> while ($row=mssql_fetch_array($result)) {
> $counter++; $c1=$row["ProductName"];
> $c2=$row["UnitPrice"];
> echo ("$counter c1: $c1 c2: $c2\n");
> }
> mssql_close($conectID);
> ?>
>
> I get: Warning: MS SQL: Unable to connect to server: ????
>
> I tried many words in there (????): "localhost", "LOCAL", PCs name, name
> that
> appears in Enterprisa Manager.... I don't know what word is asking me
> for....
> it's a stupid question, I know, but....
> [/snip]
>
> Do you know the IP address? You could try 127.0.0.1 if it is the server
> you are working on. If it is a remote server you can get the IP from
> your network admin
Thanks for your answer. I tried (Apache and DB are in the same computer) this
but I get the same error... I have SQLserver2K (personal) installed and it
works fine... What's the matter? I'm thinking on reinstall it, but I'm afraid
that will be a waste of time :(