Jump to content

if greater, equal, or less than


Crew-Portal

Recommended Posts

Hi I need some help with my code! I am making a ranking system for my Virtual airline that displays according to how many hours you filed it displays a diffrent rank allowing you to do diffrent stuff! anyways here is my code:

<?php
if ($hour == 0){
echo 'No Rank'; //I want this to be if they have nothing registered! This Part of the code works
}
elseif ($hour < 9.99){
echo 'Trainee'; //I want this to be if they have less than 9.99 hours! This Part of the code works
}
elseif (($hour >= 10) || ($hour <= 30)){
echo '1st Officer'; //I want this to be if they have less than  hours! This Part of the code works
}
elseif (($hour <= 30.01) || ($hour >= 60)){
echo 'Another Rank'; //My problem is if they have like 34 hours it doesnt display this rank but it displays ^ one
}
else { echo 'Rank Invalid'; }
?>

Can someone help me with this! I posted whats wrong with the code in the comments for the php above!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.