Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
Programming Q&A
[Help] Php page showing wrong order of ranks
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="FirefighterKyle" data-source="post: 358496" data-attributes="member: 22469"><p>Okay so I am trying to make a rank page for a game I am playing, I am having a hard time understanding why it shows the wrong ranks when I am calling something else.</p><p></p><p>Here is my code.</p><p>[PHP]<?php</p><p> </p><p> $rankCount = mysql_num_rows(mysql_query("SELECT * FROM `ranks` WHERE `type` = '1' && `branch` = 1"));</p><p> </p><p> if ($rankCount > 0)</p><p> {</p><p> for ($i=1; $i<=$rankCount; $i++)</p><p> {</p><p> $rankInfo = mysql_fetch_array(mysql_query("SELECT * FROM `ranks` WHERE `ladder` = '".$i."'"));</p><p> $getMembers = mysql_query("SELECT * FROM `members` WHERE `position` = '".$rankInfo['id']."' ORDER BY `update_date` ASC");</p><p> </p><p> echo '<a href="#">'.$rankInfo['title'].' ('.mysql_num_rows($getMembers).')</a><br />';</p><p> </p><p> if (mysql_num_rows($getMembers) > 0)</p><p> {</p><p> while($memberInfo = mysql_fetch_array($getMembers))</p><p> {</p><p> </p><p> echo '<table width="100%"></p><p> <tr></p><p> <td></p><p> <strong>Name:</strong> <a href="/member/'.$memberInfo['id'].'">'.$memberInfo['name'].'</a><br /></p><p> <strong>Tag:</strong> '.$memberInfo['tag'].'<br /></p><p> '.$memberInfo['train_promo'].' <strong>'.$memberInfo['promo_by'].'</strong> on '.date("m/d/y", $memberInfo['update_date']).'<br /></p><p> <strong>Graded by:</strong> '.$memberInfo['graded_by'].'<br /><br /></p><p> </td></tr></table>';</p><p> </p><p> }</p><p> }</p><p> else</p><p> '<i>There currently no on in this position.</i><br />';</p><p> }</p><p> }</p><p> else</p><p> '<i>This branch has no ranks yet please check back later.</i>';</p><p> ?>[/PHP]</p><p></p><p><img src="http://i.imgur.com/R7CG60h.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /> </p><p>It should show (Private, PFC, Senior Private, and Corporal) but it is showing the last 4 like so (Minister of HS, Director oO, General, and Lieuten Gen) Why won't it show the Private etc since I am saying to show "`type` = 1" ??</p></blockquote><p></p>
[QUOTE="FirefighterKyle, post: 358496, member: 22469"] Okay so I am trying to make a rank page for a game I am playing, I am having a hard time understanding why it shows the wrong ranks when I am calling something else. Here is my code. [PHP]<?php $rankCount = mysql_num_rows(mysql_query("SELECT * FROM `ranks` WHERE `type` = '1' && `branch` = 1")); if ($rankCount > 0) { for ($i=1; $i<=$rankCount; $i++) { $rankInfo = mysql_fetch_array(mysql_query("SELECT * FROM `ranks` WHERE `ladder` = '".$i."'")); $getMembers = mysql_query("SELECT * FROM `members` WHERE `position` = '".$rankInfo['id']."' ORDER BY `update_date` ASC"); echo '<a href="#">'.$rankInfo['title'].' ('.mysql_num_rows($getMembers).')</a><br />'; if (mysql_num_rows($getMembers) > 0) { while($memberInfo = mysql_fetch_array($getMembers)) { echo '<table width="100%"> <tr> <td> <strong>Name:</strong> <a href="/member/'.$memberInfo['id'].'">'.$memberInfo['name'].'</a><br /> <strong>Tag:</strong> '.$memberInfo['tag'].'<br /> '.$memberInfo['train_promo'].' <strong>'.$memberInfo['promo_by'].'</strong> on '.date("m/d/y", $memberInfo['update_date']).'<br /> <strong>Graded by:</strong> '.$memberInfo['graded_by'].'<br /><br /> </td></tr></table>'; } } else '<i>There currently no on in this position.</i><br />'; } } else '<i>This branch has no ranks yet please check back later.</i>'; ?>[/PHP] [IMG]http://i.imgur.com/R7CG60h.png[/IMG] It should show (Private, PFC, Senior Private, and Corporal) but it is showing the last 4 like so (Minister of HS, Director oO, General, and Lieuten Gen) Why won't it show the Private etc since I am saying to show "`type` = 1" ?? [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
[Help] Php page showing wrong order of ranks
Top