unidox Posted September 24, 2007 Share Posted September 24, 2007 This is my code: <img src="images/demo_20.gif" width="216" height="25" alt="" /> <table width="100%" border="0" cellspacing="0" cellpadding="0" style="background-image: url(images/demo_27.gif)"> <tr> <td><?php $mysql_table = "cp_roster"; require_once ("inc/required.inc.php"); $result = MYSQL_QUERY("SELECT * FROM $mysql_table ORDER BY type ASC") or die (mysql_error()); $result2 = MYSQL_QUERY("SELECT * FROM cp_divisions ORDER BY division_id ASC") or die (mysql_error()); $rows = mysql_num_rows($result); if ($rows == "0") { echo "<b>No Members in the roster database table.</b>"; } else { echo '<table border="0" align="center" cellpadding="0" cellspacing="3">'; $i = 0; echo "<tr><td colspan='3'><div align='center'>"; while ($mysql2=mysql_fetch_array($result2)) { if ($mysql2[image] !== "0") { ?> <img src="/games/<?=$mysql2[image]?>.gif" width="15" height="15" /> <? } else { echo "2"; ?> <? } } echo "</div></td></tr>"; while ($mysql=mysql_fetch_array($result)) { $i++; if ($i == 1) echo '<tr>'; if ($mysql[image] !== "0") { ?> <td style="border: 1px solid rgb(42,49,52)"><a href="index.php?id=roster&roster_id=<?=$mysql[roster_id]?>"><img src="<?=$imagefilepath . 'rosterpic' . $mysql[roster_id] . '.' . $mysql['imagetype']?>" width="45" height="45" border="0" onmouseover="swapOnRoster('<?=$mysql[first]?>','<?=$mysql[last]?>','<?=$mysql[alias]?>')" onmouseout="swapOffRoster()"></img></a></td> <? } else { ?> <td style="border: 1px solid rgb(42,49,52)"><a href="index.php?id=roster&roster_id=<?=$mysql[roster_id]?>"><img src="pics/roster.gif" width="45" height="45" border="0" onmouseover="swapOnRoster('<?=$mysql[first]?>','<?=$mysql[last]?>','<?=$mysql[alias]?>')" onmouseout="swapOffRoster()"></img></a></td> <? } if ($i == 4) { echo '</tr>'; $i = 0; } } if ($i != 0) echo '</tr>'; echo '</table><div id="handleDivision"> <div align="center" id="rosterHandle">Select to view profile</div> <div class="clearBoth"></div></div>'; } ?> </td> </tr> </table> What I am trying to do is have everyone on the roster have a team. It will sort the members by the team, so when you click on the team image, it goes to that part of the roster, how would I go about doing this? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/70545-roster/ Share on other sites More sharing options...
unidox Posted September 25, 2007 Author Share Posted September 25, 2007 bump Quote Link to comment https://forums.phpfreaks.com/topic/70545-roster/#findComment-354823 Share on other sites More sharing options...
unidox Posted September 25, 2007 Author Share Posted September 25, 2007 Anyone? Quote Link to comment https://forums.phpfreaks.com/topic/70545-roster/#findComment-355123 Share on other sites More sharing options...
rarebit Posted September 25, 2007 Share Posted September 25, 2007 'anchor' with html Quote Link to comment https://forums.phpfreaks.com/topic/70545-roster/#findComment-355125 Share on other sites More sharing options...
unidox Posted September 25, 2007 Author Share Posted September 25, 2007 How would I do that? Got IM so we can talk? Quote Link to comment https://forums.phpfreaks.com/topic/70545-roster/#findComment-355130 Share on other sites More sharing options...
rarebit Posted September 25, 2007 Share Posted September 25, 2007 It's very simple to do... http://www.w3schools.com/html/html_links.asp Quote Link to comment https://forums.phpfreaks.com/topic/70545-roster/#findComment-355136 Share on other sites More sharing options...
unidox Posted September 26, 2007 Author Share Posted September 26, 2007 lol, im no idiot, I need it so it doesn't refresh the page. Quote Link to comment https://forums.phpfreaks.com/topic/70545-roster/#findComment-355863 Share on other sites More sharing options...
chocopi Posted September 26, 2007 Share Posted September 26, 2007 Then you need Ajax and not PHP ~ Chocopi Quote Link to comment https://forums.phpfreaks.com/topic/70545-roster/#findComment-355867 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.