I want to create an api for android. The query menu below is not displaying everything. How to fix this? I want category,subscatery in android api. But for me, only left join in category is displayed.I have tried many times. If you know let me know i am php devloper
menu->category
INSERT INTO `menu` (`mid`, `menu_Name`, `menu_icon`) VALUES
(15, 'v', '9673-2022-08-24.png'),
(21, 'dgh', '9088-2022-08-24.jpg'),
(22, 'fg', '5378-2022-08-24.png'),
(24, 'ft', '7245-2022-08-24.png');
tbl_category->subcategory
INSERT INTO `tbl_category` (`cid`, `category_name`, `category_image`, `menu_id`) VALUES
(31, 'fgj', '2048-2022-08-24.jpg', 15),
(32, 'fgh', '0644-2022-08-24.png', 16);
this tbl_recipes->tbl_recipes
INSERT INTO `tbl_recipes` (`recipe_id`, `cat_id`, `recipe_title`, `menu_id`, `recipe_description`, `recipe_image`, `video_url`, `video_id`, `content_type`, `size`, `featured`, `tags`, `total_views`, `last_update`) VALUES
(47, 0, 'dsg', 0, '<p>sg</p>\r\n', '1661254132_Screenshot (6).png', '', 'cda11up', 'Post', '', 0, '0', 0, '2022-08-23 11:28:52'),
(48, 14, 'sad', 0, '<p>asdasd</p>\r\n', '1661254498_Ent-card-1.jpg', '', 'cda11up', 'Post', '', 0, '0', 0, '2022-08-23 18:57:49'),
(49, 25, 'fgh', 13, '<p>fghfgh</p>\r\n', '1661280418_Screenshot (5).png', '', 'cda11up', 'Post', '', 0, '0', 0, '2022-08-23 18:57:44'),
(50, 25, 'try', 13, '<p>tyt</p>\r\n', '1661281058_Screenshot (5).png', '', 'cda11up', 'Post', '', 1, '0', 0, '2022-08-23 18:57:54');
this query android
$query_category = "SELECT DISTINCT m.mid, m.menu_Name, m.menu_icon, c.cid, c.category_name, c.category_image, COUNT(DISTINCT r.recipe_id) as recipes_count FROM tbl_recipes r LEFT JOIN tbl_category c ON r.cat_id = c.cid left join menu m on m.mid=r.menu_id GROUP BY c.cid ORDER BY c.cid DESC LIMIT $limit";
i need
menu
tbl_category
tbl_recipes
ssfdfds<\/p>\r\n","video_url":"","video_id":"cda11up","content_type":"Post","featured":0,"tags":0,"total_views":0,"category_name":null}],"videos":[]}
– atozcodes Aug 25 '22 at 04:20