CURRENT_TIMESTAMP is a MySQL function, which is why you're not seeing PHP echo it as you would otherwise expect - PHP just simply doesn't understand it. I think I see your problem; change your code to look like this:
mysql_select_db was most likely not selecting your database because you weren't giving PHP a string - you were trying to pass it a constant. Incidentally, turning on error reporting would have pointed right here. I also added "or die(..." statements to each of your MySQL functions to help in further debugging in case this doesn't solve the problem.
$selected = mysql_select_db("adnetwork", $myc) or die("Unable to select database: ".mysql_error()); //note I added quotes around the DB name
$result = mysql_query("SELECT * FROM ads WHERE categoriesid = 7 AND adnum != '' AND enddate <= CURRENT_TIMESTAMP ORDER BY RAND() LIMIT 5") or die("Query failed: ".mysql_error());
//continue with your current code