Jump to content

echoindia756

Members
  • Posts

    21
  • Joined

  • Last visited

    Never

Everything posted by echoindia756

  1. Hi thanks for that! I think I almost got it working, the problem I am having now is that if there is more than one row in the table, it only displays one of the rows on the html table, is there anyway to display all of the rows that are in the table? Many thanks for your help.
  2. Hi there, I'm having a bit of trouble getting something to work. Basically, I have several fields in a table: "Item Name" and "Item Price" These values are dynamic to each user (so different items will appear depending on your username), I want to retrieve this information from the database row and put it into a HTML table on the users homepage on my website So for example the data would appear like this: Item Name Item Price Digital Camera €40.00 Underwater Camera €50.00 So I think the mysql query would be something like: mysql_query("SELECT * FROM table_name WHERE user_id = $_SESSION['user_id']"); But i'm not sure how to get all the users items to display on the table, could someone help me with the PHP code please? I'd really appreciate it! Thanks in advance!
  3. Hi guys, Does anybody have any ideas? How about if I tried something with $_SESSION ? Would that work? For example, could I put WHERE game_planets.id_owner = $_SESSION['userid'] ?
  4. You know how you said: in the "however you have your data set", what exactly goes there? Another table? e.g `game_planets.id_owner`='game_planets.name' LIMIT 1"); This is puzzling me!
  5. Ok, so when you say "=" does that mean that for example 1=1 or does it mean that they are in the same row of data? I'm just slightly confused! Thanks!
  6. Thanks! I have an ID Field in the database called id_owner and another field with the name of the planet. So would this work? mysql_query("UPDATE `game_planets` SET `belcredits`=`belcredits`+100 WHERE `name`='id_owner' LIMIT 1");
  7. Yea, that would be the logical thing - but how do I get the user id, I mean, I know you use the SELECT command to get things but how do I tell the code to identify the current user and match it up with the data in the username's field? If I could do that, that would solve the problem!
  8. You know what I mean anyway.
  9. Ok, for example: Let's say one of the errors is $SelectProduct = $_GET['whatever']; You would put that near the top of the page, and then wherever the error is, you just right it so that it says: $SelectProduct; i.e remove everything after the equals, except the semi-colon of course.
  10. Is there no way I can tell the code to only update the person's belcredits who bought the credits?
  11. You'll have to make those lines so their not relying on register_globals being on.
  12. Try typing in this right after the first "<?php" ini_set ("display_errors", "1"); error_reporting(E_ALL); That should display any errors there are.
  13. I tried a few Where Clause's, but what clause would I write so that it only updated the users credits that actually bought the credits?
  14. Do you write this code by hand? I'd suggest using Dreamweaver CS3 as it makes developing dynamic websites a piece of cake!
  15. Hi there, I'm designing an online game website. I'm having a little trouble getting something to work right. You see players of the game can buy "credits", these allow them to buy things to further their rank etc and make them stronger than other players. But the problem i'm having is that when a player buys credits, it gives that player credits, but it also gives every other player in the database credits! So if one person buys 100 credits, every user in the database gets 100 credits. This is the code i'm using: mysql_query("UPDATE `game_planets` SET `belcredits`=`belcredits`+'100'"); How would I change that code so it only updates the person's credits who actually bought them? I was thinking of something like getting the username that the user used to login, or maybe somebody can think of a better way to solve this. Thanks in advance!
×
×
  • 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.