[Solved] How to make a link this is connected to database in php


I agree with Marcosh (in the comments), so that would give you this code (between the if(…) { and } else):

echo "<table><tr><th>ID</th><th>Name</th><th>Phone Number</th><th>Country</th><th>Email</th><th>Send SMS</th><th>Link to page</th></tr>";
 // output data of each row
 while($row = $result->fetch_assoc()) {
     echo "<tr><td>" . $row["id"]. "</td><td>" . $row["firstname"]. " " . $row["lastname"]."</td><td>" . $row["phonenumber"]. "</td><td>" . $row["city"]. " ". $row["country"]. "</td><td>" . $row["email"]. "</td><td><a href="www.domain.com/check?clientid=" . $row["id"] . "&number=" . $row["phonenumber'] . ">Click me!</a></td></tr>";
 }
 echo "</table>";

Note 1: This will add a link with the text “Click me!”. I think you may want to change that. You may also want to change the header (currently “Link to page”)
Note 2: If you use php 5.5 or later, you can also use

echo "blablabla<td>{$row['id']}</td>etc..."

instead of

echo "blablabla<td>" . $row['id'] . "</td>etc..."

4

solved How to make a link this is connected to database in php