【发布时间】:2013-12-22 14:24:08
【问题描述】:
我需要将 features-table 的这些行内容之一传递给数组。但问题是我使用 iframe 来显示表格。单击特定行的图像后,我需要它发生。
在 main.php 中
<iframe id="ifrm" src="reserved_tables/reserved_rooms_table.php"></iframe>
在 reserved_rooms_table.php 中
<?php
include '../core/init.php';
$username = $user_data['username'];
$que = "SELECT * FROM ordered_rooms WHERE `username` LIKE '$username'";
$reslt = mysql_query($que);
echo '<table class="features-table" >';
echo '<thead>
<tr>
<td></td>
<td>Date</td>
<td>Start At</td>
<td>End At</td>
<td>Action</td>
</tr>
</thead>
<tbody>';
while($row = mysql_fetch_array($reslt)){
echo '<tr><td>' . $row['room_name'] .' </td><td> '. $row['date'] . '</td><td>'. $row['s_at'].'hrs</td>
<td>'. $row['e_at'].'hrs</td><td><input type="image" src="../images/cross.png" onclick="delete();" value=""></td></tr>';
}
echo "</tbody></table>";
mysql_close(); //connection closed
?>
【问题讨论】:
-
从 reserved_rooms_table.php 而不是 main.php 中获取数据,并使用 HTML 解析器。
-
我只需要通过单击交叉图像从数据库中删除这些行之一。为此,我需要将该特定行的内容放入一个数组中。
标签: php jquery ajax html-parsing