Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(isset($_POST['submit'])){
- $username=$_POST['username'];
- $password=$_POST['password'];
- $query = mysqli_query($conn, "SELECT * FROM mylogin WHERE username='$username' and password='$password'");
- if (mysqli_num_rows($query) != 0){
- echo "sucess" , header('Location: welcome.php');
- } else {
- echo "invalid username or password";
- }
- }
- ?>
- $database_name = "id2425621_login";
- $conn = mysqli_connect($servername, $username, $password, $database_name);
- if (!$conn) {
- die(mysqli_error($conn));
- }
- $sql = mysql_query("SELECT id, fname, lname, email FROM patients");
- ?>
- <table border="2" style= "background-color: #84ed86; color: #761a9b; margin: 0 auto;" >
- <thead>
- <tr>
- <th>id</th>
- <th>fname</th>
- <th>lname</th>
- <th>email</th>
- </tr>
- </thead>
- <tbody>
- <?php
- while( $row = mysql_fetch_assoc( $sql ) ){
- echo
- "<tr>
- <td>{$row['id']}</td>
- <td>{$row['fname']}</td>
- <td>{$row['lname']}</td>
- <td>{$row['email']}</td>
- </tr>n";
- }
- ?>
- </tbody>
- </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement