[eluser]Sinclair[/eluser]
Hi, I need help for listing this in a RSS feed...
The feed will contain information about The blog-post and the tags associated to the post. I have the information from two tables,
One with the posts and the other with the tags.
TABLE "POSTS"
id_post | n_post | description
1 | aaaa | aaa aaa aaa aaa
2 | bbbb | bbb bbb bbb bbb
3 | cccc | ccc ccc ccc ccc
TABLE "TAGS"
id_post|id_ordinal|n_tag
1 | 1 | tag1
1 | 2 | tag2
1 | 3 | tag3
2 | 1 | tag1
2 | 2 | tag2
3 | 1 | tag1
3 | 2 | tag2
3 | 3 | tag3
I have the idea that I must to do two foreach cicles. But I'am with doubts in the query(SQL code) that I need to do...
Code:
<?php foreach($bloposts as $post) : ?>
<?php foreach($posttags as $tags) : ?>
<?php echo $tags->n_tag; ?>
<?php endforeach; ?>
<?php echo $post->n_post . '-' . $post->description; ?>
<?php endforeach; ?>
Do tou have any ideas on how to do this?
Best Regards,