radar Posted May 25, 2008 Share Posted May 25, 2008 Okay first off I am attempting to make a helpdesk similar to: https://desk.hostdime.com/index.php?_m=knowledgebase&_a=view So I will have 2 tables, one will be helpdesk_categories which will have 2 options in it, hd_id and hd_catname The second will be helpdesk, and will have more columns... h_id hd_id h_question h_answer h_dateadded h_views I can run my SQL to get all the categories and I can get them to show... What I need to figure out how to do is to get another query to the database with a limit of like 4 for each hd_id... I thought of maybe running 2 for loops, but for the life of me i can't figure out how to setup the code to get this to happen... any help is appreciated.. Thanks. Link to comment https://forums.phpfreaks.com/topic/107207-2-db-tables-html-formatting-queries-need-help/ Share on other sites More sharing options...
bilis_money Posted May 25, 2008 Share Posted May 25, 2008 SELECT hd_id.hc, hd_catname.hc, h_id.hd, hd_id.hd, h_question.hd, h_answer.hd, h_dateadded.hd, h_views.hd FROM helpdesk_categories AS hc INNER JOIN helpdesk AS hd USING (hd_id) ORDER BY hd_id LIMIT 4; Link to comment https://forums.phpfreaks.com/topic/107207-2-db-tables-html-formatting-queries-need-help/#findComment-549678 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.