S08 Select Selected Columns

S08 Select Selected Columns
<!DOCTYPE html>
<html>
<body>

<?php
$servername = "localhost";
$username = "saurabh";
$password = "123456";
$dbname = "saurabh";

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}

$sql = "SELECT username, mobile FROM regform";
$result = $conn->query($sql);

if ($result->num_rows > 0) {
    // output data of each row
    while($row = $result->fetch_assoc()) {
        echo "<br> username: ". $row["username"]." - Mobile: ". $row["mobile"]."<br>";
    }
} else {
    echo "0 results";
}

$conn->close();
?>

</body>
</html>

Take Your Free Live Demo Class Now

We Will Call Back You Shortly

Enter Your DETAILS BELOW

We Will Send You the Course Fees Details In Below Number

Enter Your DETAILS BELOW

We Will Call Back You Shortly

Enter Your DETAILS BELOW

We Will Call Back You Shortly

Enter Your DETAILS BELOW

Enter Your DETAILS BELOW TO take

free demo class