[eluser]lucasvm[/eluser]
Hello
I got my website that display articles posted by users, so i need in that article i show the user name that created that post, also his gender, age, but i need to show also the numberof post send by him...something like this:
lucasvm has added 6 articles
i got this in my model:
Code:
function dame_articulo($id){
$sql = "miselect
WHERE id = '$id'";
$query = $this->db->query($sql);
$fav = $query->result_array();
foreach($query->result() AS $row):
$rows = $row;
return $rows;
endforeach;
}
function dame_nro_posts() {
$numero_de_posts = mysql_num_rows(mysql_query("SELECT misdatos WHERE autor = '$this->autor'"));
return $numero_de_posts;
}
Where should i do that WHERE?, any ideas? Because the article autor i get it from the first fuction called dame_articulo