Forum Moderators: coopster
if ($_SERVER["REQUEST_METHOD"] == "GET") {
// collect value of input field
$id = $_GET['id'];
}
$sql = "SELECT * FROM `Contacts` WHERE id = $id";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo "
<form action='../CreateNew.php' method='post'>
<label for='First Name'>First name:</label><br>
<input type='text' id='First Name' name='FirstName' value='.$row["FirstName"].' ><br><br>
<input type='submit' value='Submit'>
</form> echo '<input type="text" id="First Name" name="FirstName" value="' . $row["FirstName"] . '">';