Jump to content


  • Posts

  • Joined

  • Last visited


Profile Information

  • Gender
  • Location
    United Kingdom

adzie's Achievements

Regular Member

Regular Member (3/5)



  1. Sorry for dragging this up, never saw the response Muddy_Funster Yes that in essence is it.
  2. I don't think I was very clear before hand with the table structures Table one - member_awards member_id then a column for each award_id(in table 2) - this will be 1 if they have the award 0 if they don't Table two - awards award_id award_desc
  3. Ok ignore my code then. Those two tables, how would I get the result to show which ones the member has and limit it to a maximum of 5
  4. Hello all, I've inherited a rather awkward table that cannot be changed and so I need some help to limit the results. Table one - member_awards member_id then a column for each award code Table two - awards award_id award_desc $awardCodes = mysql_query("SELECT * FROM `member_awards` WHERE `member_id` = 1"); $awardsres = mysql_fetch_assoc($awardCodes); $awards = mysql_query("SELECT * FROM `awards` ORDER BY 'award_id' ASC"); while ($ac2 = mysql_fetch_assoc($awards)) { $ac22 = db_entry_check($awardsres[$ac2[award_id]])? 1 : 0; if ($ac22 != $actual && $ac22 == 1) { // DO something } } Table 1 has 20 columns, 0 if they don't have the award 1 if they do. I need to pick out 5 where they do have the award ie the column result is 1. This is where i'm getting stuck. Any points would be 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.