Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

ASP to PHP Help!

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

ASP to PHP Help!

Postby Neobis » Wed Jul 24, 2002 7:07 am

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.as ... 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.

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>
Neobis
New php-forum User
New php-forum User
 
Posts: 5
Joined: Sat Jul 20, 2002 3:42 am

Re: ASP to PHP Help!

Postby WiZARD » Wed Jul 24, 2002 11:30 pm

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.
User avatar
WiZARD
Moderator
Moderator
 
Posts: 1257
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol


Return to PHP coding => General

Who is online

Users browsing this forum: Google [Bot] and 3 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron