You need to connect to your database before the query. While I notice, you have a connection script included, that probably just defines the variables. You still need to specify for PHP to connect to the database one line above your query, like this:
$query = sprintf("SELECT * FROM blog ORDER BY idblog DESC LIMIT 10");
$data = mysql_query($query);
Now, keep in mind, this is assuming that you've defined variables for your database in that connection script you have included. If not, you'll have to include the database name, user, and password all in the mysql_select_db attributes.