I have a problem connecting to two mssql databases in one php script.
- I made two different include file to connect to the two db's
- in the php script I include both files
- my first select statement look as follows:
$msquery1 = "SELECT Dateiname FROM database1.dbo.table";
$msquery1 .= "WHERE AuftragNr = '$jobNr'";
$msresult1 = mssql_db_query($msquery1,$link1);
- the second select statement in the same file:
$msquery = "SELECT AdrName FROM database2.dbo.table";
$msquery .= "WHERE AuftragNr = '$AuftragNr'";
$msresult = mssql_db_query($msquery,$link);
I am totally stuck - when I take one select statement out and run the other one separately I get the field contents I ask for. I have no idea where I go the wrong way.
Thanks very much in advance.