SQL help in rationalizing query

I’ve written this sql which works, but I feel its not the best it could be. I’m just a novice. SELECT tbl_faults.im_id,tbl_faults_43_repeat.fault_description FROM tbl_faults INNER JOIN tbl_faults_43_repeat ON tbl_faults.id= tbl_faults_43_repeat.parent_id WHERE tbl_faults.fk_inspection_id IN (SELECT id FROM tbl_inspections WHERE dbj_vehicle = 8 AND date = (SELECT MAX(date) FROM `tbl_inspections` WHERE dbj_vehicle = 8))

Details

Any one with an idea. iam not able to receive response from my xml file when a post request is sent to it

This my exact code below: <?php $slipno = $_POST[‘slipno’]; $host = “localhost”; $user = “root”; $password = “”; $database = “payment”; //connect to the database $db = new mysqli(‘deeperlifehighschool.ipagemysql.com’, $user, $password, $database ); if($db->connect_errno > 0){ die(‘Unable to connect to database [‘ . $db->connect_error . ‘]’); } //query the database $sqlQuery = “select * FROM…

Details