Sorry Stut, I am fairly newb and don't know all the in's and out's of all
the functionality.  I thought I had a good grasp on th edatabase connection
part, but obviously was having a major oversight.  Sorry for the confusion
and THANK YOU for sticking with me to get this issue resolved.

I try not to bother the list and figure things out by myself as much as I
can, but it's hard when I was "volunteered" to become the guinea pig to
convert some of our apps from ColdFusion to PHP...especially when nobody I
work with has ever touched PHP before.  I have nobody to turn to except
google/forums/this list.

So once again, thank you, and thanks to everyone else that is helping this
novice become more familiar with PHP.


On 6/6/07, Stut <[EMAIL PROTECTED]> wrote:

Dan Shirah wrote:
> It seems that PHP is getting confused unless I post the $database =
> mssql_select_db("database", $connection) or die ('DB selection failed');
> before the query.   This is probably due to the fact that I am pulling
> information from multiple databases (Two MSSQL and One Informix)
>
> So if my query just starts out with $sql = "Select * from..." it doesn't
> really know which connection to use.

OK, that's more than a little annoying. I wish you'd mentioned that
you're using multiple database connection, this would have been so much
easier.

The mssql_query function can take the connection resource as a second
parameter. This also goes for every other database function. If you're
using multiple database connections you *need* to be passing that in. In
fact, even if you're not currently using multiple connections I would
recommend that people always pass the connection resource to the DB
functions - it saves a lot of headaches if you ever need to use a second
connection.

-Stut

Reply via email to