Welcome Guest, Not a member yet? Register   Sign In
Show number of user posts
#1

[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
#2

[eluser]toopay[/eluser]
If you post your thread in apropriate section, i believe you will get the right responses. There is no such thing, that could be considered as bug, in your case.




Theme © iAndrew 2016 - Forum software by © MyBB