I am trying to build a simple custom CMS, but I\'m getting an error:
Warning: mysqli_query() expects parameter 1 to be MySQLi, null given in
use global scope on your $con and put it inside your getPosts() function like so.
function getPosts() { global $con; $query = mysqli_query($con,"SELECT * FROM Blog"); while($row = mysqli_fetch_array($query)) { echo ""; echo "" . $row['Title'] . "" . $row['SubHeading']; echo ""; } }