Forum Moderators: coopster
here's the code:
<p><b><?=strtoupper($_GET["listtype"]."S")?> LIST</b></p>
<?
$conn=mysql_connect($dbhost, $dbuser, $dbpass);
mysql_select_db($dbname) or die ('Could not connect: ' . mysql_error());
// print "Connected to MySQL"; $query="SELECT * FROM t_media WHERE m_type=\"".$_GET["listtype"]."\" ORDER BY m_id ASC LIMIT 0, 25";
//echo $query;
$qresult = mysql_query($query);
?>
<table width="100" cellpadding="2" cellspacing="1" border="0">
<tr bgcolor="#CCCCCC">
<td>#</td><td>ID</td><td>Title</td><td>Action</td>
</tr>
<?
$i=0;
while ($line = mysql_fetch_assoc($qresult)){
$i++;
?>
<tr class="rowText" <? if($count%2==0) echo 'style="background-color:#FFFFCC; "';?>">
<td nowrap="nowrap"><?=$i?></td><td nowrap="nowrap"><?=$line["m_id"]?></td><td nowrap="nowrap"><?=$line["m_title"]?></td><td nowrap="nowrap"><a href="/<?=$line["m_type"]?>s/<?=$line["m_url"]?>" target="_blank">View</a> / <a href="index.php?action=editmedia&mediatype=<?=$line["m_type"]?>&mediaid=<?=$line["m_id"]?>">Edit</a> / <a href="index.php?action=deletemedia&mediatype=<?=$line["m_type"]?>&mediaid=<?=$line["m_id"]?>" onClick="if(confirm('Are you sure you want to delete?')) window.location='index.php?action=deletemedia&mediatype=<?=$line["m_type"]?>&mediaid=<?=$line["m_id"]?>'">Delete</a></td>
</tr>
<?}?>
</table>
<?
mysql_close($conn);
?>
Here's a little thread that shows how you can get that accomplished: [webmasterworld.com...]
Please try you best to implement the solution and if you have any trouble on the way we will be glad to assist you.
good luck