Jump to content

monkeypaw201

Members
  • Posts

    376
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Contact Methods

  • Skype
    id.rather.be.flying

monkeypaw201's Achievements

Regular Member

Regular Member (3/5)

2

Reputation

  1. uh... you lost me ??? ??? would you mind giving me a code example? maybe a link?
  2. the problem is that the ranks are stored in the database and when the administrator changes the hour requirement it needs to update, the numbers can't be hard coded..
  3. The logic: I need to get a list of ranks and hours from the database and then compare them all to the user's hours and echo what rank that user is. ie bob has 7 hours, the 2 closest ranks are: rank1 and rank2 rank1 requires 0 hours rank2 requires 10 hours it will echo rank1
  4. Parse error: syntax error, unexpected T_ELSEIF in /page.php on line 85 line 85: elseif($row_hour_count['hour_count'] > $row_rank['hours'])
  5. personally speaking, i agree with minidak03 about keeping them easy to remember, so i have directory listing turned off on my server and for some for extra simple security i capitalize the first letter of each folder (ie Images, not images)
  6. I have a query to display an appropriate rank according to how many hours they have. As such, i am having issues checking... the largest issue is that the check needs to be dynamic, in the way that it needs to check against a database for every rank in that table... <?php mysql_select_db($database_vamsys, $vamsys); $query_rankd = sprintf("SELECT * FROM vamsys_ranks ORDER BY hours ASC"); $rankd = mysql_query($query_rankd, $vamsys) or die(mysql_error()); $row_rankd = mysql_fetch_assoc($rankd); $totalRows_rankd = mysql_num_rows($rankd); mysql_select_db($database_vamsys, $vamsys); $query_rank = sprintf("SELECT * FROM vamsys_ranks ORDER BY hours ASC LIMIT 1,100"); $rank = mysql_query($query_rank, $vamsys) or die(mysql_error()); $row_rank = mysql_fetch_assoc($rank); $totalRows_rank = mysql_num_rows($rank); if($row_hour_count['hour_count'] > $row_rankd['hours']) { $rank1 = $row_rankd['title']; } do( elseif($row_hour_count['hour_count'] > $row_rank['hours']) { $rank1 = $row_rank['title']; } } while ($row_rank = mysql_fetch_assoc($rank)); ?> is what i tried but it gave me errors to no end...
  7. Now... i am looking at using something like this: <?php if($row_hour_count['hour_count'] > $row_rank['hours']) { $rank1 = $row_rank['title']; } elseif($row_hour_count['hour_count'] > $row_rank['hours']) { $rank1 = $row_rank['title']; } ?> but i need the IF statement to have the first result, and the ELSEIF have the second, with the ELSEIF looping to check all results
  8. Well they each have their own "WHERE" statements and i don't think you can mix them, can you?
  9. farther up the page: <?php $colname_hour_count = $_SESSION['pilot_id']; if (isset($_GET['pilot_id'])) { $colname_hour_count = $_GET['pilot_id']; } mysql_select_db($database_vamsys, $vamsys); $query_hour_count = sprintf("SELECT SUM(time_enroute) AS hourcount FROM vamsys_pireps WHERE pilot_id = %s AND status = 'Approved'", GetSQLValueString($colname_hour_count, "text")); $hour_count = mysql_query($query_hour_count, $vamsys) or die(mysql_error()); $row_hour_count = mysql_fetch_assoc($hour_count); $totalRows_hour_count = mysql_num_rows($hour_count); ?>
  10. output... so now i have a slight dilemma.. i need to select the rank of a user based on how many hours they have and then display that, but i tried looking it with a do..while loop which caused a lot of errors... im not sure how i can get it to do what i want... do you have any recommendations?
  11. I have some code.... <?php mysql_select_db($database_vamsys, $vamsys); $query_rank = sprintf("SELECT * FROM vamsys_ranks"); $rank = mysql_query($query_rank, $vamsys) or die(mysql_error()); $row_rank = mysql_fetch_assoc($rank); $totalRows_rank = mysql_num_rows($rank); if($row_hour_count['hour_count'] > $row_rank['hours']) { $rank = $row_rank['title']; } ?> and when i try to display $rank with <?php echo $rank; ?> i get the following displayed: I have no clue what that means... any help?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.