$idnum=$_GET['employeenumber']; $dtoday=$_GET['date']; $displaydtr = mysqli_query($con,"SELECT * FROM `dtr` WHERE idnum = '$idnum' AND edate='$dtoday'"); $row = mysqli_fetch_assoc($displaydtr); code example

Example: mysqli_fetch_assoc

<?php
	/* Connect to your database */
	$con = mysqli_query("hostname", "username", "pwd", "database");
    /* Select Columns from table*/
    $sql = "SELECT * FROM `TABLE`";
    /* Query your SQL code to SQLDatabase */
    $result = mysqli_query($con, $sql);
    /* Find rows in table*/
    $check = mysqli_num_rows($result);
    if($check > 0){
    while($data= mysqli_fetch_assoc($result)){
    /* Print all of your data*/
    echo $data["ColName"];
    }
    }
?>

Tags:

Sql Example