APD Toronto
asked on
Connecting to MS SQL with PHP
Hello Experts,
I’m a novice when it comes to PHP, but do have lots of Classic ASP experience.
I’m wondering does anyone know if it is possible to connect to a MS SQL (not mySQL) DB from GoDaddy’s 2GH Shared Linux Plan? I know that I do not have the option to setup am MS SQL DB on this hosting plan, but what if I have an external SQL Server elsewhere, could I connect to it from this hosting in PHP by just specifying the IP Address, User Name, Password and Database Name?
Assuming that I am able to connect, can anyone help me to write a test script, along the lines of:
Many Thanks.
I’m a novice when it comes to PHP, but do have lots of Classic ASP experience.
I’m wondering does anyone know if it is possible to connect to a MS SQL (not mySQL) DB from GoDaddy’s 2GH Shared Linux Plan? I know that I do not have the option to setup am MS SQL DB on this hosting plan, but what if I have an external SQL Server elsewhere, could I connect to it from this hosting in PHP by just specifying the IP Address, User Name, Password and Database Name?
Assuming that I am able to connect, can anyone help me to write a test script, along the lines of:
<%
strConn = "Driver={SQL Server}; " & _
"Server=123.456.78.987; " & _
"Database=someDB; " & _
"Uid=SOMEone; " & _
"Pwd=whoknows;"
strSQL = "SELECT * FROM Table"
rs.Open strSQL, strConn
%>
Table contents: <br><br>
<%
Do While Not rs.EOF
Response.Write(rs.Fields("fld1") & "<br>")
rs.MoveNext
Loop
%>
…but, of course, in PHP?Many Thanks.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Can anyone help me convert the above code?