The on-line php documentation is the best I've ever encountered. You can learn plenty about functions like [man]mysqli_query[man] there. the mysqli functions are just like the mysql ones but improved. Thus the "i". They also have OOP versions but I'm guessing that will just confuse you.
If you stick with the plain mysql_ functions you'll be ok.
The reason laserlight told you to add the "or die" bit is so that you could check for errors. Just calling mysql_query and not checking to see if it works is a very good way to have broken code and not understand why.
If you are getting blank output from your screen, it sounds like you have a bug in your code. I would highly recommend starting with a little code and gradually expanding it -- this way, if you run into errors you know it's the most recently added bits.
Try making sure your first bit of code works first. I would just try running this script -- but make sure that the $db vars have something in them:
<?php
$conn = mysql_connect($dbhost, $dbuser, $dbpass)
or die ('Error connecting to mysql');
mysql_select_db($dbname)
or die('Could not select ' . $dbname);
$int_y_pos = -1;
$int_y_step_small = 1;
$sql = "SELECT count(id) AS count, DATE_FORMAT(date, '%Y, %m-1, %d') AS date
FROM dtt
WHERE date NOT LIKE '0000-00-00 00:00:00'
AND date NOT LIKE '2000-00-00 00:00:00'
GROUP BY DATE_FORMAT(date, '%Y, %m, %d')";
$result = mysql_query($sql)
or die('Query failed:' . mysql_error() . "\n$sql");
$rownum = mysql_num_rows($result);
echo "complete, rownum=$rownum";
?>
EDIT: I had a bug in the originally posted code. I'm assigning the query result to $result instead of $sql.