<?php
$conn = mysql_connect("localhost", "binary_user", "binary_password")
  or die("It doesn't connect!");
mysql_select_db("binary_files", $conn) or die(mysql_errno() . ": " . mysql_error() . "<br>");

$today = date("Y-m-d", time());
$sql = "SELECT DAYOFMONTH('$today')";
$result = mysql_query($sql, $conn);
echo "The day of the month is " . mysql_result($result, 0, 0) . ".";
?>