PHP + MYSQL座位预约系统。计算免费座位

时间:2013-03-13 13:13:33

标签: php html mysql select html-table

基本上我有一个查询,可以找到这个学校大厅内的免费座位数(未预订的)。

<?php
$result = mysql_query("SELECT COUNT(*) AS freeseats FROM schoolHall WHERE status=0");
$row = mysql_fetch_array($result);
echo $row[0];
?>

在我的主页上,我目前有一个包含按钮的表格,可以将您引导至其他页面:

<table id='table-2'>
<tr>
<th>Home Page</th>
</tr>
<tr>
<td><INPUT Type="BUTTON" VALUE="School Hall" ONCLICK="window.location.href='schoolHall.php'"></td>
<td> 
.......

我希望在单独的单元格中,此按钮旁边的查询中找到空闲席位数。我该怎么做?

1 个答案:

答案 0 :(得分:1)

希望这会有所帮助;

<table id='table-2'>
<tr>
<th>Home Page</th>
</tr>
<tr>
<td><INPUT Type="BUTTON" VALUE="School Hall" ONCLICK="window.location.href='schoolHall.php'"></td>
<td><?php echo $row[0] ?></td>
<td> 
相关问题