I have 2 tables : post and images. the structure of 'post' is id, post_title, post_date and post_content and structure of images is id, path, p_id. In p_id i am storing data the value of id from table 'post' now i want that only the path related corresponding id from table 'images' and other information from table post. how can i perform the operation, kindly help me, i am stuck here to complete my project. Thanks in advance.
SELECT `post`.`id`, `post`.`post_title`, `post`.`post_date`, `post`.`post_content`, `images`.`id`, `images`.`path` FROM `post` LEFT JOIN `images` ON `images`.`p_id` = `post`.`id` WHERE `post`.`id` = 'YOURID' Have fun