Fatal error: Uncaught Error: Call to a member function query() on null

Hey again :blush:

Have another error for this line of code:

$posts = $conn->query("SELECT p.*,concat(u.firstname,' ',u.lastname) as name,u.profile_pic from posts p inner join users u on u.id = p.user_id  where p.type = 0 order by unix_timestamp(p.date_created) desc");
			while($row=$posts->fetch_assoc()):

Having a time trying to fix this…greatly appreciate the help!

Thank ya :heart:

$conn is null rather than the db connection you expect. Check your db connection code and parameters, and check your db exists and is accessible. You should be able to check for connection errors to see exactly what the problem is.

1 Like

@skawid
Thank ya so very much…will check it out :heart:

Sponsor our Newsletter | Privacy Policy | Terms of Service