$sql="SELECT * FROM payments LEFT JOIN details ON payments.id=details.id
LEFT JOIN billing_details ON details.id=billing_details.id
WHERE payments.buyer = '$user_id' AND payments.payment_status = 'Completed' order by $_GET[update_to] ";
$sql="SELECT payments.* , details.* , billing_details.* FROM payments
LEFT JOIN details ON payments.id=details.id
LEFT JOIN billing_details ON details.id=billing_details.id
WHERE payments.buyer = '$user_id' AND payments.payment_status = 'Completed' order by $_GET[update_to] ";