Pass HTML Value to Jquery to display new table

Pass HTML Value to Jquery to display new table

Hello,

Hopefully this forum can help me.  I am new to jQuery.  I have a table that displays information from MySQL and I want to have one of the cells (Date) be a clickable link to display another table.  This is my table cell
  1. <td><a href="#" onclick=display() id="astat" value="<?php $player; ?>"><?php echo $d->current()->gamedate; ?></a></td>
display() is my jQuery function.  I am trying to use jQuery to process the php variable (table id #) to kick off another mysql query to populate another table.  I am at a loss as to what this function should look like or if I am even close?

This is what I have as my function:
  1.     $(function display(){
  2.       <php
  3. $list = $pdo->query("SELECT player.player_id, game.player_id, game.pposition, game.pgoalsfor, game.pgoalsagainst, game.psog, game.ppk, game.pyellowcards, game.predcards
  4.         FROM game, player
  5.         WHERE game.player_id = '$player'");
  6. $data = $list->fetchAll(PDO::FETCH_OBJ);
  7. $aid = new ArrayIterator($data);
  8. ?>
  9.     });
That function should then populate the below table.

  1.  <tbody>
  2.       <tr>
  3.         <td><?php echo $aid->current()->pposition; ?></td>
  4.         <td><?php echo $aid->current()->pgoalsfor; ?></td>
  5.         <td><?php echo $aid->current()->pgoalsagainst; ?></td>
  6.         <td><?php echo $aid->current()->psog; ?></td>
  7.         <td><?php echo $aid->current()->ppk; ?></td>
  8.         <td><?php echo $aid->current()->pyellowcards; ?></td>
  9.         <td><?php echo $aid->current()->predcards; ?></td>
  10.         <td><?php echo $player; ?></td>
  11.       </tr>


Any help would be greatly appreciated.  I have been Googling awhile and can't seem to figure this out.  I am assuming there should be ajax in this somewhere but not sure if it can be done without it?