Member Avatar

I want to fetch invoice data from two tables table a is in single row and table b data should be multiple rows single data is fetching correctly but facing problem with table 2 multiple data fetch. php file <?php $connection= mysqli_connect("localhost","root","","invoice"); $invID = $_POST['ID']; $Invo = "SELECT a.in_no, a.client, a.add, a.Date, a.subTotal a.gTotal, b.id, b.item, b.quantity, b.price from invoice a, invoiceItems b where a.in_no = b.in_id AND in_no = '$invID' "; $runQuery = $connection->query( $Invo); if($runQuery->num_rows > 0) { $result = $runQuery->fetch_array(); } // if num_rows $connection->close(); echo json_encode($result); ?> js file function Invoice (ID = null) { if(ID) …

Member Avatar
0
18

The End.