3
I’m trying to make a connection to Sqlserver and PHP But the page returns me the following error:
Warning: mssql_connect() [Function.mssql-connect]: Unable to connect to server: 192.168.2.7 SRVDOC DOCSYSTEMSCAN in C: wamp www conexao.php on line 2
Warning: mssql_select_db() expects Parameter 2 to be Resource, Boolean Given in C: wamp www connected.php on line 3
The current code is:
<?php
$con = mssql_connect("192.168.2.7\SRVDOC\DOCSYSTEMSCAN", "sa", "minhasenha");
mssql_select_db("fd_585b0f87", $con);
?>
I’m racking my brain, but I don’t know what it is... any suggestions? Thank you.
is SQL Express ?
– user6026
Hello, not full SQL friend
– user11699
put only ip does not give ?
– user6026
This is a question I have... There I should put the server... But what is it? The ip or the server name I log in to Sqlserver?
– user11699
<?php 
$conn = mssql_connect("ADMIN-PC\SQLEXPRESS", "usuario", "senha") or die ("erro ao conectar");
where ADMIN-PC is the name of your machine and SQLEXPRESS the name of your instance of SQL Server. It’s just like when you’re logging in through the SQL Server Manager– user6026
Dude, you have configured Sqlserver for this type of connection before. It is necessary to release port 1433 and the form of connection per ip within Sqlserver.
– Paulo Sousa