hi
This code should return me an array with posts IDs who match the $tag (array), so here what I did:
foreach($tag as $k=>$v) {
while( $row=mysql_fetch_assoc($query))
{
show($row['id'].$v);
$post_tags=return_tags_by_id($row['id']);
if( in_array($v,$post_tags) && !in_array($row['id'],$matching_posts) ) {
$matching_posts[]=$row['id'];
}
} # while
} # foreach
After some testing I figured out that the while loop is getting looped only once - only at the first time, while the foreach loop is fine.
it seems like $row != mysql_fetch_assoc($query) after the first loop, so I tried to unset($row) at the beginning of each foreach loop but it doesn't work.
I'm pretty sure that there is something wrong with my while loop, but what??
Hope you can help, Thanks!