Jump to content

AirBoss36

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

About AirBoss36

  • Birthday 05/25/1970

Profile Information

  • Gender
    Male

AirBoss36's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I tried that format but it didn't work as I wanted. It seemed to add the time to the current time. I did a quick coding to test, using a value of 10,800 for x to show 3 hours remaining, but it added 3 hours to the current time of 07:00 to echo a value of 10:00:00 Any other ideas? Perhaps I coded wrong? Here is what I used: $x = 10855; echo $x; echo "<br>"; echo date("h:i:s",$x);
  2. Hi Folks, I understand the basic math to accomplish what I want, at least I think I do I would like to confirm my logic and I need help with the final output format. I am coding a simple browser based, resource type of game. The gamer will select a certain item to produce another item and it will take x time to do it. Here is the basics of what I want, minus the coding to make it look pretty. How do I format $y to show HHH:MM:SS? $complete = time() + $x; // To show how much time is remaining until completion or complete $y = $complete - time(); if $y > 0 { echo $y; } else { echo "complete"; }
  3. I am building a game website and I am working on my user registration form. Everything was working fine until I tried to add a function to include the registration date. The form is processed and it looks like it has registered the user, but there is no entry placed into the database. $join = date('Y-m-d'); mysql_query("INSERT INTO users (user_name, user_login, user_pw, user_email, user_bmonth, user_bday, user_byear, user_sex, join) VALUES ('$name', '$login', '$pass', '$em', '$_POST[bmonth]', '$_POST[bday]', '$_POST[byear]', '$_POST[sex]', '$join')"); The "join" field type is set to DATE. What am I doing wrong? Thanks
  4. If I'm using the statement correctly, why would it process the transaction if the balance is less than the transaction? Should I attack from the other direction? if ($trans > $balance) { echo "Not enough money"; exit(); } else { *** process transaction*** } ?>
  5. I want to compare two strings for an if statement.  With something like a bank account, I want it to check and see if there is enough money in the account before it performs the transaction.  Here is what I've tried: $balance = 100; $trans = 200; if (($trans < $balance) || ($trans == $balance)) {     ***perform transaction*** } ?> <html>..... Msg stating not enough money in the account. In the scenario, it should not perform the transaction, and then should carry on to the html to say that there is not enough money in the account.  At least, that's what i want it to do.  Right now, it processes the transaction even though its greater than the balance.  What am I doing wrong? Thanks.
×
×
  • 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.