i06 Posted March 27, 2009 Share Posted March 27, 2009 Hey, Having a bit of coding block at the moment with my current problem. Well to start off with once every 6 hours the page in question runs a MYSQL query and put the information into an array which is then cached using memcache. This part is to list all of the information in a dynamic hide/show option. This bit works fine but then later on down the page after a bit more information I am getting that information from the cache and I need to select the relevant ID and Name from the cached data that corresponds with the ID(s) that are given off from another MYSQL query that selects information from a different table in the DB. Currently i only have: $TagList=''; $Tags=explode('|',$Tags); array_shift($Tags); array_pop($Tags); $AllTags = $Cache->get_value('all_tags'); while(list($TagKey,$TagName)=each($Tags)) { if ($AllTags['ID']==$TagName) { $TagList1[] ='<a href="page1.php?searchtags='.$AllTags['ID'].'">'.$AllTags['Name'].'</a>'; } } $TagList = implode(', ', $TagList1); $Tags='<br /><div class="tags">'.$TagList.'</div>'; $AllTags contains the fields ID, Name and TagType. The $Tags is got from the MYSQL query and is in the context of |<TagID>|<NextTagID|. From the start I knew that the above code would not probably work but it was all that I could think of at the time. Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/151370-solved-selecting-the-same-id-from-an-array/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.