Jump to content

ashlegen

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

ashlegen's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Oh man!I checked now and i've got the poblem.You were right.$uerID never had a value because i forgot the session_start() thing at the begiing of the document.Thanks again guys and I'm looking forward to ask more here.Cheers!
  2. Yes.I'm trying to get all of the item ids associated with a specific user id into an array.I'll keep you up to date and thanks for answering.
  3. Hi guys.I've got a problem.I'm building my php browsergame and i'm stuck into the inventory page.I have a code that seems ok to me but it won't work.Here it is: $inventory = array(); $query = sprintf("SELECT id, item_id, quantity FROM user_items WHERE user_id = '%s'", mysql_real_escape_string($userID)); $result = mysql_query($query); while($row = mysql_fetch_assoc($result)) { $item_query = sprintf("SELECT name FROM items WHERE id = '%s'", mysql_real_escape_string($row['item_id'])); $item_result = mysql_query($item_query); list($row['name']) = mysql_fetch_row($item_result); array_push($inventory,$row); } I've spotted the problem.The $inventory array is empty.I checked it with if(empty($inventory)) .Thanks in advance and keep in mind that I'm a noob yet.
×
×
  • 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.