I have id
, name
and surname
in my database then i want a button on each row that will send row data to someone's email (e.g id : 1. Name: John).
<?php
`$conn = mysqli_connect('localhost','root','','test')`;
$query = "SELECT * FROM user";
$results = mysqli_query($connect, $query);
$check_results = mysqli_num_rows($results);
if ($check_results > 0) {
while ($row = mysqli_fetch_array($results)){
$id = $row['id'];
echo "<input type='button' name='send' value='$id'>";
}
}
if(isset($_POST['send'])) {
// then send data(email) on a row where button is clicked
}
?>