Jump to content

f00sh

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

f00sh's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hey guys. this might be a little a stupid or abnormal... Basically I have a row in my Database that's called "Deck" Deck is different from user to user, in this case Deck is: Derp Deck 1 2 3 4 5 6 7 8 9 10 999 I've called for this and exploded it into Array $IDs Now, these numbers are all IDs to a different database with a Field "Name". I am trying to link the IDs in Deck to the Name field in the IDs database. I am having problems making this work: $tempNAME = $_SESSION['Username']; $Deck = explode("\n", $_SESSION['Pokemon1']); $Decktotal = count($Deck); $i = 1; while($i < $Decktotal) { $result = mysql_query("SELECT Name FROM CapturedCards WHERE id='$Deck[$i]' and Owner='$tempNAME'"); $row = mysql_fetch_array($result); $Cards[] = $row[0]; echo "<p>Testing: " . $row[0]; $i++; } This sort of works... except it is only returning the very last one (In this case 999). If I add another number like 3274 to the end of the list it will do that one instead, it will always do the last one. Any help is greatly appreciated, I hope I have made myself somewhat clear, I'm basically trying to use the IDs in the array $IDs[] to call for the name in the database that corresponds to the ID and the Username of the person logged in. Thanks a lot for any information
  2. Thank you very very much, this worked perfectly. I cannot thank you enough.
  3. Hey guys, I hate to make my first post here a question, wish I could contribute more. Here is the situation, I have a working Database, I can connect to it, insert, yada yada. One of my fields in the Database is called Deck The values I have (This is an example): Derp Deck 1 2 3 4 5 6 7 8 9 10 These are entered just like this, the enters and everything. I have called this into a variable $derpdeck and it displays in an echo just find. What I was wondering is if I could put each line into an Array. so I could do like $derpdeck[3] and it would return 2. Any help is greatly appreciated.
×
×
  • 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.