When I am trying to choose t1 column 1 and t2 column 2 from database, it won't echo it out, can anyone tell me if this line is wrong?
$query_category = "SELECT recipedia_categories.category_name, recipedia_recipies.category
FROM recipedia_categories
INNER JOIN category
ON recipedia_categories.ID=recipedia_recipies.category_ID";
$result_category = $db->query($query_category);
while ($row_category = $result_category->fetch_assoc()) {
$cat_name = $row_category['category_name'];
}
and in HTML I am using
<?=$cat_name;?>
When using the fetch_assoc it gives me an error
Fatal error: Call to a member function fetch_assoc() on boolean
I hope someone can tell me what's wrong here :)