Please help me SELECT FORM WHERE in SQL code : [I have place table and I get photo field][1]


And .....

[I have trip_half_day table][2]


I want to result 

[enter image description here][3]


  [1]: https://i.stack.imgur.com/gteNj.jpg
  [2]: https://i.stack.imgur.com/RhiaQ.png
  [3]: https://i.stack.imgur.com/JqGvj.png

This is some code `<?php
        include("connect.php"); 
       
	    $strSQL = "SELECT trip_id, b.photo AS trip1, c.photo AS trip2, d.photo AS trip3, e.photo AS trip4 , a.type
	                FROM  trip_half_day a, place b, place c ,place d, place e
	                WHERE a.trip1 = b.place_id 
	                AND a.trip2 = c.place_id 
	                AND a.trip3 = d.place_id 
	                AND a.trip4 = e.place_id
	    "; 
	    
    	$objQuery = mysqli_query($connection,$strSQL);
    	$intNumField = mysqli_num_fields($objQuery);
    	$resultArray = array();
    	while($obResult = mysqli_fetch_array($objQuery))
    	{
    		$arrCol = array();
    		for($i=0;$i<$intNumField;$i++)
    		{
    			$arrCol[mysqli_fetch_field_direct($objQuery,$i)->name] = $obResult[$i];
    		}
    		array_push($resultArray,$arrCol);
    	}
    	mysqli_close($connection);
    	echo json_encode($resultArray);
?>`

How I fix it.