$sql= " select webreg__pending_order.domainname,webreg__pending_order.period,webreg__tax_invoice_item.description
,webreg__tax_invoice_item.unit_amount
from webreg__pending_order,webreg__tax_invoice_item
where webreg__pending_order.invoice_item_id = webreg__tax_invoice_item.id
and webreg__pending_order.username='$bp' and webreg__pending_order.process_date like'$x%'
and webreg__pending_order.status='Approve'
UNION
select webreg__pending_renew.domainname,webreg__pending_renew.period,webreg__tax_invoice_item.description
,webreg__tax_invoice_item.unit_amount
from webreg__pending_renew,webreg__tax_invoice_item
where webreg__pending_renew.invoice_item_id = webreg__tax_invoice_item.id
and webreg__pending_renew.username='$bp' and webreg__pending_renew.process_date like'$x%'
and webreg__pending_renew.status='Approve'
UNION
select webreg__pending_transfer_in.domainname,webreg__pending_transfer_in.period,
webreg__tax_invoice_item.description,webreg__tax_invoice_item.unit_amount
from webreg__pending_transfer_in,webreg__tax_invoice_item
where webreg__pending_transfer_in.invoice_item_id = webreg__tax_invoice_item.id
and webreg__pending_transfer_in.username='$bp' and webreg__pending_transfer_in.process_date like'$x%'
and webreg__pending_transfer_in.status='Approve'