Php - how to get related posts from same table in mysql

I have a table named tbl_topstories (topstory_id,topstory_title,topstory_description,meta_tag,da‌​te) so i want related posts from this table matched with meta_tag column for that please let me know how to do it… thank you for replay

https://dev.mysql.com/doc/refman/5.7/en/select.html

that’s cruel, man

SELECT this.topstory_title , related.topstory_title AS related_title , related.topstory_description AS related_description , related.date AS related_date FROM tbl_topstories AS this INNER JOIN tbl_topstories AS related ON related.meta_tag = this.meta_tag WHERE this.topstory_id = 937

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.