Creating Functions off multiple SQL databases
<p>I'm trying to get a function to work (Extremely new to functions btw) And this is what I have, but when I implement it into my page it doesn't turn any results. Is anybody able to see what's wrong in this?   </p>

<pre><code>public function get_character() {
        $con=mysql_connect("****","****","****");
        mysql_select_db("accounts", $con);
        $id = mysql_query("SELECT id FROM account WHERE username = '" . $username . "'");
        global $characterdb;
        $info = $characterdb-&gt;get_row("SELECT `name` FROM `characters` WHERE `account` = '" . $characterdb-&gt;escape($id) . "' AND `active`=1");
        if(is_object($info))
            return $info-&gt;character;
        else
            return '';
    }
</code></pre>
