ok I knocked this up but unsure how to get the rooms to the mysql
<?
$cat = $_GET['cat'];
if ($cat == "") {
include_once('pages/list-blank.php');
return;
}
if ($cat == "CC") {
$category = "City Chats";
} else if ($cat == "CP") {
$category = "Computing";
} else if ($cat == "EA") {
$category = "Entertainment";
} else if ($cat == "GN") {
$category = "General";
} else if ($cat == "LS") {
$category = "Lifestyles";
} else if ($cat == "SP") {
$category = "Spirituality";
} else if ($cat == "NW") {
$category = "News";
} else if ($cat == "PR") {
$category = "Peers";
} else if ($cat == "RL") {
$category = "Religion";
} else if ($cat == "RP") {
$category = "Roleplay";
} else if ($cat == "RM") {
$category = "Romance";
} else if ($cat == "TN") {
$category = "Teens";
}
$result = mysql_query("SELECT * FROM rooms WHERE category = '$category'");
?>
<table wpgidth="2100" border="0">
<tr>
<td>
<?
$pgid = $_GET["pgid"];
if ($pgid == "") { $pgid = "0"; } ?>
<div id="tnt_pagination">Pages
<span class="active_tnt_link">
<?
for ($i = 0; $i < mysql_num_rows($result); $i++) {
if (!strstr($i/"10", ".")) {
if ($pgid != $i) { ?>
<a href="?pgid=<?=$i?>"><? }
?><?=$i/"10" + 1?><?
if ($pgid != $i) { ?></a><? }
}
} ?></span>
</div>
<img src="http://bumblebeechat.net/icons/earth.png"><strong>Official Groups <img src="http://bumblebeechat.net/icons/users.png">Supported Groups</strong></p></td>
</tr>
</table>
<table style="border:1px solid #2E64FE; background-color:#E9F4FA; width:100%;">
<tr>
<td align="center" width="29%"><p class="bing"><strong>Roomname</strong></p></td>
<td align="center" width="60%"><p class="bing"><strong>Topic</strong></p></td>
</tr>
</table>
<? # display pgid number links
$num_rows = mysql_num_rows($result);
if(!$result || ($num_rows < 0)){ echo "<strong>Couldn't show you my results!</strong>"; return; }
if($num_rows == 0){ echo "<strong>Couldn't find any rooms! Someone still need to create a first room!</strong>"; return; }
# Display table contents */
$e = true;
for($i=$pgid; $i < $pgid + "10"; $i++){
if ($i >= $num_rows) { ?>
<?
return;
}
$name = mysql_result($result,$i,"name");
$epuid = bin2hex($name);
$about = mysql_result($result,$i,"about");
$level = mysql_result($result,$i,"level");
//echo $about;
?>
<table width="100%">
<tr>
<td width="200" style="border:1px solid #2E64FE;"><p class="bing"><?php if($level == 1) { echo "<img src='http://bumblebeechat.net/icons/earth.png' width='25' height='25'>" ; } else if($level == 2) { echo "<img src='http://bumblebeechat.net/icons/users.png' width='25' height='25'>" ; } ?></p><p class="bing"><strong><a href="chat.php?rm=<?=$name;?>"><?=$name;?></a></strong</p></td>
<td width="500" style="border:1px solid #2E64FE;"><?=$about;?></td>
</tr>
</table>
<? } ?>
many thanks