osea en la parte de elimianr como le hago para el button ejecute elc codigo y elimine cada elemento N elemenos sin tener que darle valores?
Código (html4strict) [Seleccionar]
<?php
include ("conexion.php");
$sql = "SELECT * FROM baby_names";
$records = mysql_query($sql) or die (mysql_error());
?>
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>employee</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/login.css">
</head>
<body>
<nav class="navbar navbar-default">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Daycare</a>
</div>
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-user">Profile</span><span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="#"><span class="glyphicon glyphicon-cog"></span>Settings</a></li>
<li><a href="#"><span class="glyphicon glyphicon-edit"></span>Edit</a></li>
<li><a href="#"><span class="glyphicon glyphicon-repeat"></span>Change your password</a></li>
<li class="divider"></li>
<li><a href="#"><span class="glyphicon glyphicon-off">Sign out</span></a></li>
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-flag">Reports</span><span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="#">Top seller list</a></li>
<li><a href="#">Top seller list</a></li>
</ul>
</li>
</ul>
<ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="#"><span class="glyphicon glyphicon-home">Parents</span></a></li>
<li><a href="#"><span class="glyphicon glyphicon-home">Category</span></a></li>
<ul>
</nav>
<div class="container">
<div class="row">
<div class="col-md-3">
<ul class="nav nav-pills nav-stacked">
<li class="active"><a href="view.php"><span class="glyphicon glyphicon-home"></span>Home</a></li>
<li><a href="#">Presentation</a></li>
<li><a href="#">aaa</a></li>
<li><a href="#">Home</a></li>
<li><a href="#">Home</a></li>
<li><a href="#">Home</a></li>
<li><a href="#">Users</a></li>
</ul>
</div>
<div class="col-md-9 well">
<div>
<form method="POST" class="navbar-form navbar-left" action="add_kids.php">
<button type="button" class="btn btn-success" data-toggle="modal" data-target="#myModal"><span class="glyphicon glyphicon-plus"></span>Add kids</button>
<input type="text" class="form-control" placeholder="search">
<br/>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">Add kids</h4>
</div>
<div class="modal-body">
<form method="POST" action="add_kids.php" >
<div class="form-group">
<label for="baby-name">Baby name</label>
<input type="text" class="form-control" name="bby-name">
</div>
<div class="form-group">
<label for="Gender">Gender</label>
<select class="form-control" name="Gender">
<option>Select an option</option>
<option id="F">Female</option>
<option id="M">Male</option>
</select>
</div>
<div class="form-group">
<label for="phone">Phone</label>
<input type="text" class="form-control" name="phone">
</div>
<div class="form-group">
<label>Parent's name</label>
<input type="text" class="form-control" name="parents_name">
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="submit" name="submit" class="btn btn-success">Submit</button>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
<!-- Tab panes -->
<div class="container" id="name">
<ul class="nav" role="tablist">
<li class="active"><a href="#daftar" role="tab" data-toggle="tab">Data</a></li>
</ul>
<!-- Tab panes -->
<div class="tab-content" id="table2">
<div class="table-responsive">
</br>
<table class="table table-hover">
<thead>
<tr>
<th>ID</th>
<th>Name</th>
<th>Gender</th>
<th>Age</th>
<th>Phone</th>
<th>Actions</th>
</tr>
<?php
while($row = mysql_fetch_assoc($records))
{
echo "<tr>";
echo "<td>".$row['ID_baby']."</td>";
echo "<td>".$row['Baby_name']."</td>";
echo "<td>".$row['Baby_name']."</td>";
echo "<td>".$row['Baby_name']."</td>";
echo "<td></td>";
echo "<td><button type='submit' name='edit' class='btn btn-warning'><a href='edit.php' id='button'><span class='glyphicon glyphicon-edit'></span> Edit</a></button> <button type='submit' name='delete' class='btn btn-danger'><a href='delete.php' id='button'><span class='glyphicon glyphicon-trash'></span> Delete</a></button></td>";
echo'';
echo "<tr>";
}//endwhile
?>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
<script src="js/jquery.js"></script>
<script src="js/bootstrap.js"></script>
<script src="js/elements.js"></script>
</body>
</html>
Código (php) [Seleccionar]
<?php
include_once("conexion.php");
mysql_query("DELETE FROM baby_names WHERE ID_baby=46");
header("Location: index_employee.php");
?>