
September 2nd, 2003, 11:10 PM
|
|
Contributing User
|
|
Join Date: Jun 2003
Posts: 72
Time spent in forums: 11 m 36 sec
Reputation Power: 6
|
|
|
How to make a php function loop when getting data
how do I make this code loop so instead of showing only 1 line of data it shows all of it
PHP Code:
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
<tr>
<td style="border-style:solid; border-width:1px; " align="center" width="34%">
<b><font face="Verdana" size="1"><u>Map Name:</u></font></b></td>
<td style="border-style:solid; border-width:1px; " align="center" width="33%">
<b><font face="Verdana" size="1"><u>Map Type</u></font></b></td>
<td style="border-style:solid; border-width:1px; " align="center" width="33%">
<u><font face="Verdana" size="1"><b>Delete</b></font></u></td>
</tr>
<?
$DB2 = mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable to connect to database");
@mysql_select_db("$DBName") or die("Unable to select database $DBName");
$sql2 = "select mapname from maps_official where maptype='2'";
$result2 = mysql_query($sql2,$DB2);
while ($row2 = mysql_fetch_array($result2))
{
$len2 = strlen($row2['mapname']) - 4;
$map_no_ext2 = substr($row2['mapname'],0,$len2);
}
?>
cs maps<br>
<font face="Verdana" size="1">
<tr>
<td style="border-style:solid; border-width:1px; " align="center" width="34%"><font face="Verdana" size="1"><?= $map_no_ext2 ?></font></td>
<td style="border-style:solid; border-width:1px; " align="center" width="33%"><font face="Verdana" size="1">cs</font></td>
<td style="border-style:solid; border-width:1px; " align="center" width="33%">
<font face="Verdana" size="1"><a href="javascript:void(0)" onclick="openPopUp('editmap.php?mapname=<?= $map_no_ext2 ?>','_new','channelmode=no,directories=no,toolbar=no ,location=no,status=no,menubar=no,scrollbars=yes,r esizable=no,width=450,height=400')">edit map</a>
/ <a href="javascript:void(0)" onclick="openPopUp('deleteconfirm.php?mapname=<?= $map_no_ext2 ?>','_new','channelmode=no,directories=no,toolbar=no ,location=no,status=no,menubar=no,scrollbars=yes,r esizable=no,width=450,height=80')">delete map</a></td>
</tr>
</font>
|