Jump to content

estcod

New Members
  • Content Count

    2
  • Joined

  • Last visited

Community Reputation

0 Neutral

About estcod

  • Rank
    Newbie
  1. Thank you for answer.. <?php if( isset($_POST['oak']) ){ $oak= $_POST['oak']; $sql = "UPDATE users SET oak=$oak+1"; echo "You cut a tree down!"; } ?> <form action="demo.php" method="POST"> <input type="submit" name="oak" value="Cut a tree!"> </form> So, now i'm thinking.. ..move right direction with this code? Code not show errors or smth but now i stand little problem, cut a tree and page refesh show me the ECHO and not updated my oak amounts on sql.
  2. Hello! I have little problem with my code.. and my head blow up... Code is php <?php include 'db.php'; if( isset($_POST['oak']) ){ $alltree = $_POST['alltree']; $oak= $_POST['oak']; $sql = "UPDATE users SET $puud = $puud + 1, $sirel=$sirel+1"; } if (mysqli_query($sql)) { echo "'+1 Oak tree added!"; } ?> <form action="demo.php" method="post"> <input type="submit" name="oak" value="Cut a tree!"> </form> My vision is.. if press CUT A TREE! and page updated.. and update my oak amount at mysql data.. So, i'm newbie but i take a little journey
×
×
  • 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.