打开一个弹出窗口从mysql php动态选择ID获取值?

时间:2015-02-24 13:33:31

标签: php mysql popup popupwindow

如何在mysql php页面中打开弹出窗口?使用表来显示多个行值,如果我单击(在每个行名称末尾有一个按钮,如"查看")任何一行意味着它将显示所有信息并从mysql表中获取值。

  <head>
  <script language="JavaScript" type="text/javascript"> 

  function PopWindow(url, win) 
  { 
  var ptr = window.open(url, win,
  'width=850,height=350,top=100,left=100');
  return false;
  }
  </script>
 </head>

<body>
<table class="table table-hover table-nomargin dataTable table-bordered">
<thead>
<tr>
    <th>S.NO</th>
    <th>Shop Name</th>
    <th>Owner Name</th>
    <th>E-mail</th>
    <th>Phone</th>
    <th>Country</th>
    <th>Option</th>
</tr>
</thead>
<tbody>
<?php 
include 'connection/db_connection.php';
$sql=mysql_query("select * from franchise_list");
$i=1;
while($row=mysql_fetch_array($sql))
{
echo '<tr>
<td>'.$i.'</td>
<td>'.$row['shop_name'].'</td>
<td>'.$row['owner_name'].'</td>
<td>'.$row['email'].'</td>
<td>'.$row['phone'].'</td>
<td>'.$row['country'].'</td>
<td><a class="example7 btn" href="view_export.php?id='.$row['export_no'].'" rel="tooltip" onclick="return PopWindow(this.href, this.target);"><i class="icon-search"></i></a>
</td>
</tr>';
$i++;
}

?>

</tbody>
</table>
</body>

如果我点击&#34;查看&#34;按钮链接意味着它将打开弹出窗口并显示值,使用where子句从mysql表中获取所有值。与每行相同。

0 个答案:

没有答案