在PHP中调用while循环中的变量

<?php
// Create connection
$con=mysqli_connect("localhost","root","root");
mysql_select_db("test") or die( "Unable to select database");
if (mysqli_connect_errno())
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }

 //***************************** table 1 detail ***********

$query = "SELECT * FROM fraud WHERE a_number=" . $_GET["aNun_id"];
echo "<title>" . $_GET["aNun_id"] . "</title>";         
echo "<table width='50%' border='5'>
      <tr>
    <th>Date & Time</th>
      <th>A Number</th>
      <th>B Number</th>
    <th>Status</th>
      </tr>";       

$result=mysql_query($query) or die (mysql_error());
while($row=mysql_fetch_array($result))
{
  echo "<tr>";
  echo "<td>" . $row['date'] . "</td>";
  echo "<td>" . $row['a_number'] . "</td>";
  echo "<td><a href='?bNun_id=".$row['b_number']."'>" . $row['b_number'] . "</a></td>";
  echo "<td>" . $row['status'] . "</td>";
  echo "</tr>";  
}
echo "</table>";

//***************************** table 2 detail ***********

//Here i'm trying to use bNum_id in below query    
$query = "SELECT * FROM fraud WHERE b_number=" . $_GET["bNun_id"];          
echo "<table width='50%' border='5'>
      <tr>
    <th>Date & Time</th>
      <th>A Number</th>
      <th>B Number</th>
    <th>Status</th>
      </tr>"; 

$result=mysql_query($query) or die (mysql_error());

while($row=mysql_fetch_array($result))
{
  echo "<tr>";
  echo "<td>" . $row['date'] . "</td>";
  echo "<td>" . $row['a_number'] . "</td>";
  echo "<td>" . $row['b_number'] . "</td>";
  echo "<td>" . $row['status'] . "</td>";
  echo "</tr>";  
}
echo "</table>";

//connection close
mysqli_close($con);
?>

Here in table one , I used aNun_id to get the data from another PHP file with "GET" command. In the table two, I want bNun_id to show its related data in that table. How do i call bNun _id data to the second table from table one. Pls help me..

Are those two tables in the same page? If so, You need to append the bNum_id to the same query string to use both aNum_id & bNum_id.

 echo "<td><a href='?aNun_id=".$_GET["aNun_id"]."&bNun_id=".$row['b_number']."'>" . $row['b_number'] . "</a></td>";