Forums
This topic is locked
ASP to PHP Code
Posted 21 Apr 2006 01:35:53
1
has voted
21 Apr 2006 01:35:53 Joey Washburn posted:
I am working on porting some stuff to PHP from ASP for reasons to long to list here.Anyway I have this piece of code from my current ASP page
<pre id=code><font face=courier size=2 id=code> <%
While ((Repeat1__numRows <> 0) AND (NOT rsTrack.EOF))
if iTracksLineBreak >=6 then
Response.Write "</tr>"
response.Write "<tr>"
iTracksLineBreak = 1
End if
%>
<td valign="top"><p align="center"><A HREF="detailride.asp?<%= Server.HTMLEncode(MM_keepURL) & MM_joinChar(MM_keepURL) & "ID=" & rsTrack.Fields.Item("ID".Value %>"><%=(rsTrack.Fields.Item("DisplayName".Value)%></A><br>
<A HREF="detailride.asp?<%= Server.HTMLEncode(MM_keepURL) & MM_joinChar(MM_keepURL) & "ID=" & rsTrack.Fields.Item("ID".Value %>"><img src="<%=(rsTrack.Fields.Item("pic_thumb".Value)%>" alt="" border="0"></A></p>
</td>
<%
iTracksLineBreak = iTracksLineBreak + 1
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsTrack.MoveNext()
Wend
%>
</tr>
</table>
<p>
<%
rsTrack.Close()
Set rsTrack = Nothing
%> </font id=code></pre id=code>
I need help converting it to PHP, I have some of it done, but I cant get this part to work right
<pre id=code><font face=courier size=2 id=code>While ((Repeat1__numRows <> 0) AND (NOT rsTrack.EOF))
if iTracksLineBreak >=6 then
Response.Write "</tr>"
response.Write "<tr>"
iTracksLineBreak = 1
End if
</font id=code></pre id=code>
Basically I am pulling a record and the thumbnail photos from the database and i want it to display 5 of them across and then line break
Replies
Replied 21 Apr 2006 18:17:14
21 Apr 2006 18:17:14 Roddy Dairion replied:
By the looks of it, it something like
<pre id=code><font face=courier size=2 id=code>
$SQL= "you need a mysql query here"
$query = mysql_query($SQL);
while ($row=mysql_fetch_array($SQL))
{
$i = 0;
if ($i >= 6)
{
echo "</tr>";
echo "<tr>";
$i++;
}
}
</font id=code></pre id=code>
I might be wrong but this is what it looks like to me.
<pre id=code><font face=courier size=2 id=code>
$SQL= "you need a mysql query here"
$query = mysql_query($SQL);
while ($row=mysql_fetch_array($SQL))
{
$i = 0;
if ($i >= 6)
{
echo "</tr>";
echo "<tr>";
$i++;
}
}
</font id=code></pre id=code>
I might be wrong but this is what it looks like to me.