Welcome Guest, Not a member yet? Register   Sign In
my_model, queries and joins
#5

[eluser]threestate[/eluser]
i appreciate your help.. and maybe i'm being thick.. but..

in my controller:
Code:
$data['page_content'] = $query_content;

in my view:
Code:
<?php foreach($page_content as $row) : ?>
post id = &lt;?php echo $row['post_id'];?&gt;<Br>
title - &lt;?php echo $row['title'];?&gt;<br>
category name - &lt;?php echo $row['name'];?&gt;<Br>
category id - &lt;?php echo $row['cat_id'];?&gt;<br>
<hr>
&lt;?php endforeach;?&gt;



so when i run this, if a post belongs to multiple categories, it will post multiple times.. where and how am i doing this.. say if i wanted the results to be

post id <Br>
title <br>
category name1,category name2,category name3
<hr>

etc

again, i really appreciate your help



Messages In This Thread
my_model, queries and joins - by El Forum - 04-16-2012, 12:56 PM
my_model, queries and joins - by El Forum - 04-16-2012, 02:41 PM
my_model, queries and joins - by El Forum - 04-16-2012, 02:55 PM
my_model, queries and joins - by El Forum - 04-16-2012, 02:57 PM
my_model, queries and joins - by El Forum - 04-16-2012, 03:14 PM
my_model, queries and joins - by El Forum - 04-16-2012, 03:24 PM
my_model, queries and joins - by El Forum - 04-16-2012, 03:29 PM
my_model, queries and joins - by El Forum - 04-16-2012, 03:39 PM
my_model, queries and joins - by El Forum - 04-16-2012, 04:30 PM
my_model, queries and joins - by El Forum - 04-16-2012, 04:33 PM
my_model, queries and joins - by El Forum - 04-16-2012, 04:45 PM
my_model, queries and joins - by El Forum - 04-16-2012, 06:33 PM
my_model, queries and joins - by El Forum - 04-16-2012, 07:02 PM



Theme © iAndrew 2016 - Forum software by © MyBB