Link to home
Start Free TrialLog in
Avatar of eaweb
eawebFlag for undefined

asked on

dsnless connection

hi
i have this dsn less mssql server connection on a webserver in my intranet:
//===========SERVER CONNECTION===========

$server="localhost,1433";
$username="sa";
$password="";
$database="Northwind";

//===========SERVER CONNECTION===========

but now i want to connect to another mssql server on another machine on my intranet. i tried to use instead of the server localhost the computername or the sql server name of the other machine but nothing! it keep giving me errors.

some help please!!!!!!
Avatar of Deepak Vasudevan
Deepak Vasudevan
Flag of India image

What error are you getting?
Avatar of eaweb

ASKER

these are the errors i get:

Warning: mssql_connect() [function.mssql-connect]: message: Login failed for user 'sa'. Reason: Not associated with a trusted SQL Server connection. (severity 14) in D:\www\webroot\evmel\php\mssql.php on line 14

Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: saldis21,1433 in D:\www\webroot\evmel\php\mssql.php on line 14

Warning: mssql_select_db(): supplied argument is not a valid MS SQL-Link resource in D:\www\webroot\evmel\php\mssql.php on line 15

Warning: mssql_query() [function.mssql-query]: message: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. (severity 14) in D:\www\webroot\evmel\php\mssql.php on line 29

Warning: mssql_query() [function.mssql-query]: Unable to connect to server: (null) in D:\www\webroot\evmel\php\mssql.php on line 29

Warning: mssql_query() [function.mssql-query]: A link to the server could not be established in D:\www\webroot\evmel\php\mssql.php on line 29

Warning: mssql_fetch_array(): supplied argument is not a valid MS SQL-result resource in D:\www\webroot\evmel\php\mssql.php on line 30


if i use the sql sever name on the webserver self , it's no problem but if i use the name of the sql server on the other network machine, BAM ERRORS!!!!!!!!

example: with this no problem either. WORKS FINE!!
salbko92 is the computer name and name of the sql server on the webserver
$server="salbko92,1433";
$username="sa";
$password="";
$database="Northwind";
Avatar of mpemberton5
mpemberton5

From my recollection, there are three different types of authentications available on MSSQL.  Windows auth, MSSQL auth, and a combination of both.  My guess is that this other server may be set to Windows only and you'll need to provide windows auth credentials to connect to it.

You can set the other server to use both auth methods, but it'll require a restart.
Avatar of eaweb

ASKER

i cannot set it to mix mode in the security. i click on the option and then ok, but when i review the properties again it is set bek to windows only
Seems like there is another step to take.  Although I have never done this personally, it does seem that this is the practiced method to change over the authentication.  I don't know why the registry has to be edited, but it's MS....

http://support.microsoft.com/default.aspx?scid=kb;EN-US;q285097
Avatar of eaweb

ASKER

ok thanks i will look at the web page.

now this problem

<input name="buttonSearch" type="submit"  id="buttonSearch" value="Search">

if($buttonSearch == "Search"){
$sqlquery="SELECT companyName FROM Customers WHERE companyName = 'Island Trading';";

//===========SQL QUERY===========


//===========QUERY RESULTS===========

$results= mssql_query($sqlquery);
while ($row=mssql_fetch_array($results)){
echo $row['companyName']."<br>\n";}

}

what is the problem here because i'am still getting an error on submit.
Error
Notice: Undefined variable: buttonSearch in D:\www\webroot\evmel\projects\listcontrol\search.php on line 101


where do i have to declare the variable
Avatar of eaweb

ASKER

i want the query in php be executed when clicking on submit
ASKER CERTIFIED SOLUTION
Avatar of mpemberton5
mpemberton5

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial