I am trying to display the output of this query:
$resultReturn = $con->prepare( "SELECT `returns`.`return_id`, `returns`.`return_ZDTicket`, status.status_description, orders.customer_email\n"
. "FROM `returns` \n"
. " LEFT JOIN `status` ON `returns`.`return_status` = `status`.`status_id`\n"
. " LEFT JOIN `agents` ON `returns`.`agent_id` = `agents`.`id`\n"
. " LEFT JOIN `orders` ON `returns`.`return_orderID` = `orders`.`order_id`\n"
. "WHERE `agents`.`id` = ? ");
$resultReturn->bind_param('i', $id);
$resultReturn->execute();
$resultReturn->store_result();
$resultReturn->bind_result($returnID, $returnZD, $returnStatus,$returnCustomerEmail);
$arrayReturnID[] = array();
$arrayreturnZD[] = array();
$arrayreturnStatus[] = array();
$arrayreturnCustomerEmail[] = array();
while ($resultReturn->fetch()){
array_push($arrayReturnID,$returnID);
array_push($arrayreturnZD,$returnZD);
array_push($arrayreturnStatus,$returnStatus);
array_push($arrayreturnCustomerEmail,$returnCustomerEmail);
}
array_splice($arrayReturnID, 0, 1);
array_splice($arrayreturnZD, 0, 1);
array_splice($arrayreturnStatus, 0, 1);
array_splice($arrayreturnCustomerEmail, 0, 1);
$returnsTable = array($arrayReturnID,$arrayreturnZD,$arrayreturnStatus,$arrayreturnCustomerEmail);
if we print the $returnsTable this is the result:
Array ( [0] => Array ( [0] => 2 ) [1] => Array ( [0] => 268903 ) [2] => Array ( [0] => OPEN ) [3] => Array ( [0] => mariorossi@testnetatmo.com ) )
This is my table:
<tbody>
<tr>
<th>Return ID</th>
<th>ZD Ticket</th>
<th>Return Status</th>
<th>Customer Email</th>
</tr>
<?php ?>
<tr>
</tr>
<?php ?>
</tbody>
</table>
</div>
Can you please help me display the table? It is driving me crazy, php is not my thing! :( Thankyou!