Try this:
(assume two tables, A and B, A has columns id and name, B has columns id and phone)
$sql= "select * from A, B ".
"where A.id=B.id ".
"order by A.id";
$q= mysql_query($sql);
while($r= mysql_fetch_array($q)){
echo("ID: ".$r['id'].", Name: ".$r['name'].", Phone: ".$r['phone']);
}