Untitled

 avatar
unknown
plain_text
5 months ago
1.2 kB
6
Indexable
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <form method="post">
        <input type="submit" value="Employee Report" name="Employee">
        <input type="submit" value="Department Report" name="Department">
    </form>
</body>
</html>

<?php


if(isset($_POST["Employee"])){
    $conn=mysqli_connect("localhost","root","","mydatabase");
    $stmt="SELECT * FROM `employee`";
    $result=mysqli_query($conn,$stmt);
    echo "<table>";
    while($row=mysqli_fetch_array($result)){
        echo "<TR><TD>$row[0]< /TD><TD>$row[1]</TD><TD>$row[5]</TD><TD>$row[6]</TD><TD><img src=$row[7] width=50 height=50></TD></TR>";
    }

    echo "</table>";
}
if(isset($_POST["Department"])){
    $conn=mysqli_connect("localhost","root","","mydatabase");
    $stmt="SELECT * FROM `department`";
    $result=mysqli_query($conn,$stmt);
    echo "<Table>";
    while($row=mysqli_fetch_array($result)){
        echo "<TR><TD>$row[0]</TD><TD>$row[1]</TD><TD>$row[2]</TD><TD>$row[3]</TD></TR>";
    }
    echo "</table>";
}

?>
Editor is loading...
Leave a Comment