我正在显示数据库中的表格。我想在行中添加一个复选框,以便我可以选择我想要的任何行并使用它执行操作。我正在努力处理我的代码,所以我想在这里分享,如果有人可以帮助我尽可能地帮助我。提前谢谢。
<?php
mysql_connect('localhost', '233apps', '233apps');
mysql_select_db('car_sales');
$sql="SELECT * FROM general_reservation";
$records=mysql_query($sql);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="../../favicon.ico">
<title>Intellect Group Ltd.</title>
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="css/lightbox.css">
<!-- Custom styles for this template -->
<link href="jumbotron.css" rel="stylesheet">
<!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
<!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
<script src="../../assets/js/ie-emulation-modes-warning.js"></script>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div><nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">IG Homepage</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
</div><!--/.navbar-collapse -->
</div>
</nav>
<!-- Main jumbotron for a primary marketing message or call to action -->
<br>
<br>
<div class="container">
<!-- Example row of columns -->
<div class="row">
<table width = "1000" border="2" cellpadding="1" cellspacing="1">
<tr>
<th>Car Type</th>
<th>Trim</th>
<th>Year made</th>
<th>km</th>
<th>Exterior Colour</th>
<th>options</th>
<th>Cost After Duty </th>
<th>reserver</th>
<tr>
<?php
echo "<b><center>Minister Database Records</center></b><br><br>";
while($general_reservation=mysql_fetch_assoc($records)){
echo "<tr>";
<span class="field"> <input type="checkbox" name="reservation_id" value="<?php echo $value('reservation_id'); ?>"/> </span>
echo "<td>".$general_reservation['car_type']."</td>";
echo "<td>".$general_reservation['trim']."</td>";
echo "<td>".$general_reservation['year_made']."</td>";
echo "<td>".$general_reservation['km']."</td>";
echo "<td>".$general_reservation['exterior_colour']."</td>";
echo "<td>".$general_reservation['options']."</td>";
echo "<td>".$general_reservation['car_cost']."</td>";
echo "<td>".$general_reservation['reserver']."</td>";
echo "</tr>";
}
?>
</table>
</div>
</div> <!-- /container -->
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="js/jquery-1.11.0.min.js"></script>
<script src="js/lightbox.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="../../dist/js/bootstrap.min.js"></script>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
</body>
</html>