I have a database that contains an autoincrement id, the location and the date's trip. With this code I can show on display the result of my query.
$mysqli = new mysqli("localhost", "root", "password", "trip");
$result = $mysqli->query("SELECT * FROM news WHERE location = '$location'");
echo "<br/><h3>"."Result, I found " .$result->num_rows. " results.". "</h3><br/>";
while($row = $result->fetch_assoc()) {
echo "<tr><td>".$row["location"]."</td><td>".$row["date"]."</td><td>".' <button type="submit" value="reserve"/>'. "</td></tr>";
}
How can I know which button the user click to reserve his trip?