Accessing foreign data can only be done using ORMs. They can inspect the DB structure and mine the data you need on the fly. In this case, they will handle the queries for you.
But i imagine you want / need to handle your data by hand the old way.
You can achieve this by making a joint query, like for example :
SELECT o.serial AS serial, d.productid AS productid, d.price AS price, d.quantity AS quantity, o.total AS total, o.date AS date
FROM order_detail d LEFT JOIN orders o ON o.serial = d.orderid LEFT JOIN billing b ON b.serial = o.customerid
WHERE b.userid = '$username';
By the way, one shouldn't store in a DB a value that can be calculated on the fly (example: the order.total column that is a SUM() of related prices and quantities).
In my own opinion, you shouldn't use hand made queries like this. It exposes you to SQL injection, data formatting / typing issues and such mess.