shantanuo
shantanuo

Reputation: 32286

Hyperlink for each record

I need a link for each depotname that will bring up a child window with the details of the last 10 backup status.

while($data=mysql_fetch_array($res))
{
if(is_null($depot_array) || !in_array($data['depotname'],$depot_array        ))
{
$depot_array[$r]=$data['depotname'];
if($data['SCP_status'] <> 'success')
{
echo "<tr id='fail'>";

The results of the following query should be displayed in a child window.

select * from backup_log where depotname = $data['depotname']

Upvotes: 0

Views: 126

Answers (2)

Luke Stevenson
Luke Stevenson

Reputation: 10351

Somewhere after the First Code Block, add:

echo '<a href="depot.php?depotname='.urlencode( $data['depotname'] ).'" target="_blank">Show Depot</a>';

Create a New File (depot.php), which will then use the $_GET['depotname'] parameter and perform the required SQL Query.

It is very difficult (or impractical) to try and share content or SQL actions performed by the Parent Window into a Child Window.

Upvotes: 1

ntan
ntan

Reputation: 2205

Create a link that will open a new window

echo '<a href="javascript:void(0)" onclick="window.open('depot.php?depotname='.urlencode( $data['depotname'] )','newWindow','width=400,height=200');return false" >show</a>

Upvotes: 1

Related Questions