WmZilla - Webmaster and Marketplace

The Next Generation Webmaster and Trade Forum

Retrieve data with the same id values in Table 2 and display Bread Crumb

DandeNada

New member

0

0%

Status

Offline

Posts

54

Likes

0

Rep

0

Bits

281

3

Months of Service

0%
I would like to retrieve entries in my blog_post table that have the same post category ID as the "kat_id" in the categories table to create Bread Crumbs. I would appreciate your help. I couldn't solve it with this code: $categories = $db->prepare('SELECT postkat_id FROM blog_post INNER JOIN categories ON categories.kat_id = blog_post.postkat_id WHERE postkat_id = kat_id'); $categories->execute(); if ($categories->rowCount()) { foreach ($categories as $row) { echo $row['cat_name']; } }
 

249

6,622

6,642

Top