Jump to content

gitn32

Members
  • Posts

    26
  • Joined

  • Last visited

Everything posted by gitn32

  1. And you are logged in as a user. So I guess the problem is my query: mysql_query("UPDATE users SET accbal = '$newaccbal' WHERE id = $_POST['id'] AND username = '$user'"); This is what I have, and I'm using the hidden input, but it comes up with a error.
  2. I have the if isset post submit. But I don't understand the part about transferring the id to update the amount. I'm am fairly new to this, and am just looking for some help.
  3. If fixed this on my real code. Let me re-explain the problem. I have 2 pieces of data. They are both displayed on the webpage. They each have the own account balance. For example, 1 can be 500, and the other can be 750. Lets say 500 is on the top of the page. I click the remove button, and 750 (which is on the bottom of the page) is subtracted from the account balance. I would like to make it where, when I click the top amount (500), that 500 is subtracted from the account balance, instead of 750. Your guys are telling me what's wrong with my HTML, which I have fixed. I appreciate that, but it's not the question. Please trty and help with the one above, if you can't help then that's fine. I appreciate your guys' time.
  4. Yes that was helpful. But not to this question: I have multiple pieces of data. Each piece of data has its own submit button when displayed. If there is 2 pieces of data and I hit the top button, the bottom data is the accbalance. I want to make it so that if I hit the top button the top button the newaccbal is the amount of the top.
  5. Thanks, but that wasn't the question......
  6. Ok the first problem is solved, how about this: $result = mysql_query ("SELECT * FROM invoices WHERE username='$user'"); while($row = mysql_fetch_array($result)) { $username = $row['username']; $bill = $row['invoice']; $ammount = $row['ammount']; $id = $row['id']; echo " <font size='3' face='arial'> <table width='250' border='0' cellspacing='1' cellpadding='0'> <tr> <td><b>$id, $bill: $$ammount</b></td> </tr> <tr> <td><form action=bills.php method=POST<input type=submit name=submit value=Remove</form></td> </tr> </table> </font> "; if(isset($_POST['submit'])) { $got_error = 0; if ($accbal > $ammount){ $naccbal = $accbal - $ammount; require ("userconnect.php"); mysql_query("UPDATE users SET accbal = '$naccbal' WHERE username = '$user'"); } else { $got_error = 1; echo "Not enough money in account."; } } //$accbal IS defined before code starts //And there is an extra $ before $ammount so it displays a dollar sign, and the ammount. I'm also having the same problem with this, and this is different because your updating not deleting. This is a virtual funding system.
  7. Thank you! If you have time can you show me what the edited one is. Once I add the hidden input I would like to check that it is correct.
  8. Here is my code: $result = mysql_query ("SELECT * FROM $tbl_name WHERE username='$user'"); while($row = mysql_fetch_array($result)) { $username = $row['username']; $email = $row['password']; $age = $row['age']; $id = $row['id']; echo " <font size='3' face='arial'> <table width='250' border='0' cellspacing='1' cellpadding='0'> <tr> <td><b>$id, $username,$password,$email,$age</b></td> </tr> <tr> <td><form action=delete.php method=POST><input type=submit name=submit value=Remove></form></td> </tr> </table> </font> "; if(isset($_POST['submit'])) { $got_error = 0; mysql_query(" DELETE $id FROM $tbl_name); } else { $got_error = 1; echo "Error."; } } I have multiple pieces of data. Each piece of data has its own submit buttton when displayed. If there is 2 pieces of data and I hit the top button, the bottom data is deleted. I want to make it so that if I hit the top button the top button is deleted. Please help.
  9. gitn32

    PHP My Admin

    ?
  10. gitn32

    PHP My Admin

    It told me this "This website requires you to log in."
  11. gitn32

    PHP My Admin

    Do you know how to run it?
  12. gitn32

    PHP My Admin

    I actually just installed Wamp.
  13. gitn32

    PHP My Admin

    No, not that I'm aware of.
  14. gitn32

    PHP My Admin

    Hi. I would like help on how to install phpMyAdmin on windows 7 Acer.
  15. Well I was thinking like a virual funding system for roleplay. First a login (without a register page and were I have to add the members). Then a bank page were you can view your account balance/citations/bills. And if you have any citations/bills were you can pay them and your account balance will automaticly be subtracted. And lastly a my account page were you can change your password/ email. Thats basiclly it. But I need to be able to add members, and add citations/bills. Like I said im new to PHP so im not sure if you can really even do this. But hopefully its possible.
×
×
  • 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.