How can I connect to a database?
So what's happening is you're querying a database that you're not connected to.

db_set_active('default');


...that makes the active database the Drupal default (the one it was installed on, usually).

$query = mysql_query("SELECT * FROM news");


...that doesn't actually do anything.  That is a MySQL Library function (i.e. not part of the Drupal API), so Drupal doesn't actually interact with it.

Now, depending on what you're trying to do here, it's not clear if you're trying to query a table that's part of the Drupal installation or if it's a secondary, external table in a database you're trying to connect to... however, based on the logic you're using I'm going to assume the table is in the Drupal database.

If news is a table in the default Drupal database, then what you want to use is db_query, and the API information for it is located here https://api.drupal.org/api/drupal/includes%21database%21database.inc/function/db_query/7.  You can read about interacting with the Drupal database through the Drupal API there.

Here's an example I pulled from the Migrate module:

$query = db_select('migrate_example_beer_topic', 'met')
         -&gt;fields('met', array('style', 'details', 'style_parent', 'region','hoppiness'))
         // This sort assures that parents are saved before children.
         -&gt;orderBy('style_parent', 'ASC');


Notice you don't actually have to specify the database you're connecting to, it just assumed 'default'.

In fact, for that matter, you should install the Migrate module and go through the examples that it has.  They come with the module, and will be accessible under sites/all/modules/migrate/migrate_example.