<?php

$password = $_POST['PWD'];

$con=mysqli_connect("localhost","scosen_wgsiw",$password,"scosen_wgsiw");
// Check connection
if (mysqli_connect_errno())
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }

$result = mysqli_query($con,"SELECT * FROM basketball WHERE Status<99 AND (STime<NOW() OR RATING=0) ORDER BY STime DESC");
while($row = mysqli_fetch_array($result))
  {
  echo $row['ID'] . "\n";
  }

mysqli_close($con);
?>