ASP to PHP Help!

A

Anonymous

Guest
Hi,

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 neobis@zapo.net

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

http://www.blah.com/advanced_results.asp?TypeSearch=Team+Name&advquery=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.

Thanks.
(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>
</tr>

<tr>
<td width="183" valign="top" align="left" bgcolor="#FFCC33" class="infocell">
<p<?=$rs["Date1"]; ?></p>
</td>
<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>
</tr>
</table>
 
Hi!
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.
 
Back
Top