ASP to PHP help
- Started
- Last post
- 14 Responses
- bellerus
I'm trying to translate this snippet into a php database connection, and since I'm not a great programmer, I just can't get it right.
Can someone out there help me translate this to php?
Set dbAgentDat = Server.CreateObject("ADODB.Conne...
dbAgentDat.Open("provider=sqlole...Any help would be appreciated!
- gabriel20
are you trying to connect php to SQL?
- bellerus0
Yes, it seems it would just be a basic php connection to a remote SQL server, but I haven't gotten anything to work.
- mike0
bell-
are you using the mysql_connect function with all of the necessary parameters?
- enobrev0
you might want to look into the adodb class http://adodb.sf.net/ which allows you to set up database connect strings (for about 10 or so different databases) like asp's ado notation.
- bellerus0
Yeah, I'm wondering if it's the adodb part that's not causing my mysql_connect(). It just tells me that it can't connect to the remote server. If that database wasn't allowing outside connections, would the error message be different?
- mike0
is the remote db server mySQL or a Microsoft database?
- bellerus0
I've been told the remote db is a plain sql server. If that's the case, I wouldn't need to setup an adodb connection would I? The errors I'm getting are either a lost connection or can't connect.
- gabriel20
you won't be able to use mysql_connect if it isn't a mysql database. I'd try using odbc for connecting to a sql database:
- bellerus0
Thanks Gabriel, I'll try that.
- chl0
Keep in mind, "a plain SQL server" is really a meaningless statement. That could mean a lot of things. If, for example, it's a Postgres DB server, then you're not gonna have a lot of luck with those MySQL connecting functions.
- bellerus0
Yeah, the guy who's in charge of the database I'm trying to connect has language issues.
- chl0
Yeah, two things I'd get straight real quick.
1) Exactly what kind of DB server is it.
2) Is it accessible remotely from your IP address.
The answer to #2 is "no" by default on MySQL in most hosting setups I've seen.
- bellerus0
Here's his verbose answer : It's Microsoft SQL Server and the database is supposedly "open"
- mike0
did you try the odbc functions?