Table of Contents
Insert values in Table
connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully
";
// select database
$username=$_POST["username"];
$password=$_POST["password"];
$email=$_POST["email"];
$mobile=$_POST["mobile"];
$address=$_POST["address"];
$dateofbirth=$_POST["dateofbirth"];
$sql = "INSERT INTO regform (username, password, email, mobile, address, dateofbirth)
VALUES ('$username', '$password', '$email', '$mobile', '$address', '$dateofbirth')"
;
$result = $conn->query($sql);
?>
Select Gender = Female
connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully
";
// select database
$gender=$_POST["gender"];
$sql = "SELECT * FROM registrationform where gender='$gender'";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo "".$row["username"]. "
".
$row["email"]. "
".
$row["mobile"]. "
---------------------------
";
}
} else {
echo "0 results";
}
?>