<?php
$servername = "localhost";
$username = "oscotech_oscopt";
$password = "oscopt";
$dbname = "oscotech_portal";

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

$sql = "SELECT matricno, department, courses FROM ndii_tbl where matricno='1810110002'";
$result = $conn->query($sql);

if ($result->num_rows > 0) {
  // output data of each row
  while($row = $result->fetch_assoc()) {
    echo "matricno: " . $row["matricno"]. " - department: " . $row["department"]. " " . $row["courses"]. "<br>";
  }
} else {
  echo "0 results";
}
$conn->close();
?>