ASP to PHP Help!

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply

Wed Jul 24, 2002 7:07 am


I am trying to convert from ASP to PHP. I am having problems passing values from one screen to another. I can do simple PHP stuff (i.e retrieving stuff from a mySQL db etc) I cannot convert my ASP connection string(s) to a PHP one in this case! Help! I can do it for simple pages etc.

Can somebody try an convert this ASP to PHP for me please? My email address is

The address string I normally would pass into my asp page (below) would be : ... ery=Celtic

My ASP is below. Thaks for any help in advance, if perferred you can email me your sugguestions / help etc. As above any help would be much appreciated.

(p.s : Connection stuff is in ASP code the rest should be PHP stuff)
Dim strDB
strDB = "Driver={MySQL};DATABASE=fixtures;SERVER=ESDDEV2;UID=root;PWD=;"

Const adOpenForwardOnly = 0
Const adLockReadOnly = 1
Const adCmdText = &H0001
Const adUseClient = 3

Dim con
Set con = CreateObject("ADODB.Connection")
con.Open strDB

Dim SqlVar

SqlVar = "SELECT * FROM Fixtures"

If Request.QueryString("TypeSearch") ="Team Name" Then
SqlVar = SqlVar & " WHERE Fixtures.TeamName LIKE '%" & _
Request.QueryString("advquery") & "%' ORDER BY TeamID ASC"

Dim rs
Set rs = CreateObject("ADODB.Recordset")
rs.CursorLocation = adUseClient
rs.PageSize = recordsToShow
rs.CacheSize = recordsToShow
rs.Open SqlVar, strDB, 3, 3

End If

<TABLE width="600" border="0" cellpadding="2" cellspacing="1">
<td class="EventTitle" width="297" valign="top" align="center" bgcolor="#efefef">Home / Away</td>
<td class="EventTitle" width="365" valign="top" align="center" bgcolor="#efefef">Team</td>
<td class="EventTitle" width="365" valign="top" align="center" bgcolor="#efefef">Score</td>
<td class="EventTitle" width="365" valign="top" align="center" bgcolor="#efefef">Match Info</td>

<td width="183" valign="top" align="left" bgcolor="#FFCC33" class="infocell">
<p<?=$rs["Date1"]; ?></p>
<td class="description" width="297" valign="top" align="center" bgcolor="#efefef"><?=$rs["HorA1"]; ?></td>
<td class="description" width="365" valign="top" align="center" bgcolor="#efefef"><?=$rs["Week1"]; ?></td>
<td class="description" width="365" valign="top" align="center" bgcolor="#efefef"><?=$rs["Week1Score"]; ?></td>
<td class="description" width="365" valign="top" align="center" bgcolor="#efefef"><a href="<?=$rs["TeamName"]; ?>MatchDetails.asp?MatchID=01" onFocus="if(this.blur)this.blur()">Info</a></td>

User avatar
Posts: 1240
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol

Wed Jul 24, 2002 11:30 pm

If you convert code via hands, than simly write new code in PHP
if you know structure of your DB(MySQL, PosgreSQL ets.). It's more easy than rewrite ASP.
"Sex,Drugs and Rock&Roll " replaced at "Sucks,Bugs and Plug&Play";

Post Reply