I have a code:
<body>
<?php
global $wpdb;
$sql = "";
$sql = "SELECT * FROM emgAdmin";
$sql = "$sql INNER JOIN wp_posts ON wp_posts.ID = emgAdmin.ID_OfPost ";
$ArrResult = $wpdb->get_results($sql);
while ($emgAdminResult = mysql_fetch_object($ArrResult)) {
echo($emgAdminResult->post_date);
}
?>
</body>
and I'm getting an error that says,"Call to a member function get_results() on null" ...
I have tested the sql and it did worked, rendering all that data that I wanted.
I dont know why I'm getting the error with the get_results() function of wordpress when I have already defined the global $wpdb