wolfcry044 Posted January 3, 2007 Share Posted January 3, 2007 I used to have a PHP/SQL web designer for my gaming clan, but he left. He made a site, but I accidently deleted the database for it because it was using the same database as the forums, and back then I did not know how it all worked. I've been learning PHP for about 4 days now, and have an ok grasp on how things work. I'm going to post here the my old web designers code for the Roster page. Can someone give me a sketch as to how the database would have looked, by looking at the information I'm about to provide? I just need to know how to create the database again, so that I can start unraveling what he did, and learn how he did it. Thanks! [code]<?php require_once('Connections/conn_local.php'); ?><?phpmysql_select_db($database_conn_local, $conn_local);$query_rs_cadet = "SELECT user_id, username, user_rank, user_image, rank_id, rank_title, rank_image FROM phpbb_9999users, phpbb_9999ranks WHERE user_rank = rank_id AND rank_value > 20 AND rank_value < 25 AND user_onleave = 0 ORDER BY rank_value ASC, username ASC";$rs_cadet = mysql_query($query_rs_cadet, $conn_local) or die(mysql_error());$row_rs_cadet = mysql_fetch_assoc($rs_cadet);$totalRows_rs_cadet = mysql_num_rows($rs_cadet);mysql_select_db($database_conn_local, $conn_local);$query_rs_juniors = "SELECT user_id, username, user_rank, user_image, rank_id, rank_title, rank_image FROM phpbb_9999users, phpbb_9999ranks WHERE user_rank = rank_id AND rank_value > 12 AND rank_value < 21 AND user_onleave = 0 ORDER BY rank_value ASC, username ASC";$rs_juniors = mysql_query($query_rs_juniors, $conn_local) or die(mysql_error());$row_rs_juniors = mysql_fetch_assoc($rs_juniors);$totalRows_rs_juniors = mysql_num_rows($rs_juniors);mysql_select_db($database_conn_local, $conn_local);$query_rs_seniors = "SELECT user_id, username, user_rank, user_image, rank_id, rank_title, rank_image FROM phpbb_9999users, phpbb_9999ranks WHERE user_rank = rank_id AND rank_value > 4 AND rank_value < 13 AND user_onleave = 0 ORDER BY rank_value ASC, username ASC";$rs_seniors = mysql_query($query_rs_seniors, $conn_local) or die(mysql_error());$row_rs_seniors = mysql_fetch_assoc($rs_seniors);$totalRows_rs_seniors = mysql_num_rows($rs_seniors);mysql_select_db($database_conn_local, $conn_local);$query_rs_command = "SELECT user_id, username, user_rank, user_image, rank_id, rank_title, rank_image FROM phpbb_9999users, phpbb_9999ranks WHERE user_rank = rank_id AND rank_value > 0 AND rank_value < 5 AND user_onleave = 0 ORDER BY rank_value ASC, username ASC";$rs_command = mysql_query($query_rs_command, $conn_local) or die(mysql_error());$row_rs_command = mysql_fetch_assoc($rs_command);$totalRows_rs_command = mysql_num_rows($rs_command);mysql_select_db($database_conn_local, $conn_local);$query_rs_special = "SELECT user_id, username, user_rank, user_image, rank_id, rank_title, rank_image FROM phpbb_9999users, phpbb_9999ranks WHERE user_rank = rank_id AND rank_value = 99 AND user_onleave = 0 ORDER BY rank_value ASC, username ASC";$rs_special = mysql_query($query_rs_special, $conn_local) or die(mysql_error());$row_rs_special = mysql_fetch_assoc($rs_special);$totalRows_rs_special = mysql_num_rows($rs_special);mysql_select_db($database_conn_local, $conn_local);$query_rs_onleave = "SELECT user_id, username, user_rank, user_image, rank_id, rank_title, rank_image FROM phpbb_9999users, phpbb_9999ranks WHERE user_rank = rank_id AND rank_value > 0 AND rank_value < 25 AND user_onleave = 1 ORDER BY rank_value ASC, username ASC";$rs_onleave = mysql_query($query_rs_onleave, $conn_local) or die(mysql_error());$row_rs_onleave = mysql_fetch_assoc($rs_onleave);$totalRows_rs_onleave = mysql_num_rows($rs_onleave);mysql_select_db($database_conn_local, $conn_local);$query_rs_boxinfo = "SELECT box_headline, box_content FROM website_boxes WHERE box_id = 10";$rs_boxinfo = mysql_query($query_rs_boxinfo, $conn_local) or die(mysql_error());$row_rs_boxinfo = mysql_fetch_assoc($rs_boxinfo);$totalRows_rs_boxinfo = mysql_num_rows($rs_boxinfo);?><?php include('includes/header.php'); ?> <table width="255" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="dynamic_images/dyn_img_small_table.php?text=<?php echo $row_rs_boxinfo['box_headline']; ?>" alt="" width="255" height="50" border="0" /></td> </tr> <tr> <td valign="top" class="small_table_bg"> <div id="small_table_text"> <?php echo $row_rs_boxinfo['box_content']; ?> </div> </td> </tr> <tr> <td><img src="images/table_small_bottom.jpg" alt="" width="255" height="30" border="0" /></td> </tr> </table> </td> <td valign="top"> <?php if ($totalRows_rs_command > 0) { // Show if recordset not empty ?> <table width="512" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="dynamic_images/dyn_img_large_table.php?text=Command Officers (<?php echo ($totalRows_rs_command) ?>)" alt="" width="513" height="50" border="0" /></td> </tr> <tr> <td valign="top" class="large_table_bg"> <div id="large_table_text"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <?php do { ?> <tr> <td align="center"><a href="bio.php?id=<?php echo $row_rs_command['user_id']; ?>"><?php echo $row_rs_command['username']; ?></a></td> <td width="200" align="center"><a href="ranks.php"><?php echo $row_rs_command['rank_title']; ?></a></td> <td width="115" align="center"><img src="../forums/templates/UAF%20Theme/images/ranks/<?php echo $row_rs_command['rank_image']; ?>" alt="<?php echo $row_rs_command['rank_title']; ?>" /></td> </tr> <?php } while ($row_rs_command = mysql_fetch_assoc($rs_command)); ?> </table> </div></td> </tr> <tr> <td><img src="images/table_large_bottom.jpg" alt="" width="513" height="30" border="0" /></td> </tr> </table> <?php } // Show if recordset not empty ?> <?php if ($totalRows_rs_seniors > 0) { // Show if recordset not empty ?> <table width="512" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="dynamic_images/dyn_img_large_table.php?text=Senior Officers (<?php echo ($totalRows_rs_seniors) ?>)" alt="" width="513" height="50" border="0" /></td> </tr> <tr> <td valign="top" class="large_table_bg"> <div id="large_table_text"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <?php do { ?> <tr> <td align="center"><a href="bio.php?id=<?php echo $row_rs_seniors['user_id']; ?>"><?php echo $row_rs_seniors['username']; ?></a></td> <td width="200" align="center"><a href="ranks.php"><?php echo $row_rs_seniors['rank_title']; ?></a></td> <td width="115" align="center"><img src="../forums/templates/UAF%20Theme/images/ranks/<?php echo $row_rs_seniors['rank_image']; ?>" alt="<?php echo $row_rs_seniors['rank_title']; ?>" /></td> </tr> <?php } while ($row_rs_seniors = mysql_fetch_assoc($rs_seniors)); ?></table> </div> </td> </tr> <tr> <td><img src="images/table_large_bottom.jpg" alt="" width="513" height="30" border="0" /></td> </tr> </table> <?php } // Show if recordset not empty ?> <?php if ($totalRows_rs_juniors > 0) { // Show if recordset not empty ?> <table width="512" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="dynamic_images/dyn_img_large_table.php?text=Junior Officers (<?php echo ($totalRows_rs_juniors) ?>)" alt="" width="513" height="50" border="0" /></td> </tr> <tr> <td valign="top" class="large_table_bg"> <div id="large_table_text"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <?php do { ?> <tr> <td align="center"><a href="bio.php?id=<?php echo $row_rs_juniors['user_id']; ?>"><?php echo $row_rs_juniors['username']; ?></a></td> <td width="200" align="center"><a href="ranks.php"><?php echo $row_rs_juniors['rank_title']; ?></a></td> <td width="115" align="center"><img src="../forums/templates/UAF%20Theme/images/ranks/<?php echo $row_rs_juniors['rank_image']; ?>" alt="<?php echo $row_rs_juniors['rank_title']; ?>" /></td> </tr> <?php } while ($row_rs_juniors = mysql_fetch_assoc($rs_juniors)); ?></table> </div> </td> </tr> <tr> <td><img src="images/table_large_bottom.jpg" alt="" width="513" height="30" border="0" /></td> </tr> </table> <?php } // Show if recordset not empty ?> <?php if ($totalRows_rs_cadet > 0) { // Show if recordset not empty ?> <table width="512" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="dynamic_images/dyn_img_large_table.php?text=Cadets (<?php echo ($totalRows_rs_cadet) ?>)" alt="" width="513" height="50" border="0" /></td> </tr> <tr> <td valign="top" class="large_table_bg"> <div id="large_table_text"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <?php do { ?> <tr> <td align="center"><a href="bio.php?id=<?php echo $row_rs_cadet['user_id']; ?>"><?php echo $row_rs_cadet['username']; ?></a></td> <td width="200" align="center"><a href="ranks.php"><?php echo $row_rs_cadet['rank_title']; ?></a></td> <td width="115" align="center"><img src="../forums/templates/UAF%20Theme/images/ranks/<?php echo $row_rs_cadet['rank_image']; ?>" alt="<?php echo $row_rs_cadet['rank_title']; ?>" /></td> </tr> <?php } while ($row_rs_cadet = mysql_fetch_assoc($rs_cadet)); ?></table> </div> </td> </tr> <tr> <td><img src="images/table_large_bottom.jpg" alt="" width="513" height="30" border="0" /></td> </tr> </table> <?php } // Show if recordset not empty ?> <?php if ($totalRows_rs_special > 0) { // Show if recordset not empty ?> <table width="512" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="dynamic_images/dyn_img_large_table.php?text=Special Ranks (<?php echo ($totalRows_rs_special) ?>)" alt="" width="513" height="50" border="0" /></td> </tr> <tr> <td valign="top" class="large_table_bg"> <div id="large_table_text"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <?php do { ?> <tr> <td align="center"><a href="bio.php?id=<?php echo $row_rs_special['user_id']; ?>"><?php echo $row_rs_special['username']; ?></a></td> <td width="200" align="center"><a href="ranks.php"><?php echo $row_rs_special['rank_title']; ?></a></td> <td width="115" align="center"><img src="../forums/templates/UAF%20Theme/images/ranks/<?php echo $row_rs_special['rank_image']; ?>" alt="<?php echo $row_rs_special['rank_title']; ?>" /></td> </tr> <?php } while ($row_rs_special = mysql_fetch_assoc($rs_special)); ?></table> </div> </td> </tr> <tr> <td><img src="images/table_large_bottom.jpg" alt="" width="513" height="30" border="0" /></td> </tr> </table> <?php } // Show if recordset not empty ?> <?php if ($totalRows_rs_onleave > 0) { // Show if recordset not empty ?> <table width="512" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="dynamic_images/dyn_img_large_table.php?text=Members On Leave (<?php echo ($totalRows_rs_onleave) ?>)" alt="" width="513" height="50" border="0" /></td> </tr> <tr> <td valign="top" class="large_table_bg"> <div id="large_table_text"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <?php do { ?> <tr> <td align="center"><a href="bio.php?id=<?php echo $row_rs_onleave['user_id']; ?>"><?php echo $row_rs_onleave['username']; ?></a></td> <td width="200" align="center"><a href="ranks.php"><?php echo $row_rs_onleave['rank_title']; ?></a></td> <td width="115" align="center"><img src="../forums/templates/UAF%20Theme/images/ranks/<?php echo $row_rs_onleave['rank_image']; ?>" alt="<?php echo $row_rs_onleave['rank_title']; ?>" /></td> </tr> <?php } while ($row_rs_onleave = mysql_fetch_assoc($rs_onleave)); ?></table> </div> </td> </tr> <tr> <td><img src="images/table_large_bottom.jpg" alt="" width="513" height="30" border="0" /></td> </tr> </table> <?php } // Show if recordset not empty ?> </td> </tr> </table> <?php include('includes/footer.php'); ?><?phpmysql_free_result($rs_cadet);mysql_free_result($rs_juniors);mysql_free_result($rs_seniors);mysql_free_result($rs_command);mysql_free_result($rs_special);mysql_free_result($rs_onleave);mysql_free_result($rs_boxinfo);?>[/code] Link to comment https://forums.phpfreaks.com/topic/32674-can-i-get-a-database-sketch-based-on-this-information/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.