DSN-less mySQL connections?
Posted: Mon Nov 04, 2002 2:29 pm
Hi everyone...
I've been working with ASP for a while, and decided that I'd prefer to work with PHP after looking at the code and how much easier it is to work with.
However, I've been looking for a couple days now to see if there was a way to get a DSN-less connection to a database with PHP.
For example, ASP allows the ability to connect to a database that has not been added to the DSN ODBC of the server using the following code :
<%
Set MyConn = Server.CreateObject("ADODB.Connection")
MdbFilePath = Server.MapPath("salesstuff.mdb")
MyConn.Open "Driver={Microsoft Access Driver _
(*.mdb)}; DBQ=" & MdbFilePath & ";"
%>
Is there a way to do something similar in PHP? I ask because I have access to a remote server where I'd like to put a lot of my PHP work, but I don't want to have to pay up the extra cash for them to put my mySQL database in the DSN of the server.
Thanks a lot!
I've been working with ASP for a while, and decided that I'd prefer to work with PHP after looking at the code and how much easier it is to work with.
However, I've been looking for a couple days now to see if there was a way to get a DSN-less connection to a database with PHP.
For example, ASP allows the ability to connect to a database that has not been added to the DSN ODBC of the server using the following code :
<%
Set MyConn = Server.CreateObject("ADODB.Connection")
MdbFilePath = Server.MapPath("salesstuff.mdb")
MyConn.Open "Driver={Microsoft Access Driver _
(*.mdb)}; DBQ=" & MdbFilePath & ";"
%>
Is there a way to do something similar in PHP? I ask because I have access to a remote server where I'd like to put a lot of my PHP work, but I don't want to have to pay up the extra cash for them to put my mySQL database in the DSN of the server.
Thanks a lot!