Call to a member function fetch_assoc() on a non-object

I’m a super beginner. I did find related questions here but I think they’re too advanced for my skills. :-(

Here’s my function:

function get_fname($un){

$registerquery = $this->conn->query("SELECT f_name FROM tz_members WHERE 
                     usr='".$un."'");

while ($row = $registerquery->fetch_assoc()) { 
    return $fname = $row[$un];
    }
}

Any help plsss??

Leave a Reply

*

Hire Me
Follow Me!
Search
Most Popular Articles & Pages
Because your vote is Important
Sorry, there are no polls available at the moment.
Categories