select plots.*,purchased_plots.tree_name,purchased_plots.amount,purchased_plots.purchase_id, purchased_plots.transaction_id, pmpf.planted_for , pmpf.admin_approve as pmpf_admin_approve from purchased_plots left join plots on purchased_plots.plot_id=plots.Id left join plot_msg_plnt_fr pmpf on pmpf.purchase_id=purchased_plots.purchase_id where purchased_plots.purchase_id='' markerdetail['purchase_id'] '' and purchased_plots.parent_plot='0' order by purchased_plots.tree_name