I'm trying to create a widget for Wordpress. The widget displays the records from the database.
function.php in themes/vigilance/ :
if (function_exists('register_sidebar_widget'))
{
    register_sidebar_widget('TwiMoldova','twimoldova');
}
function twimoldova()
{
    include('widgets/twimoldova.php');
}
themes/vigilance/widgets/twimoldova.php:
<?php
    echo "<p>";
?>
<div class="widget" style="border-width:thin; border-style:solid; padding: 7px; font-size: 14px;">
    <?php
        define('DB_HOST', 'host');
        define('DB_NAME', 'name');
        define('DB_USER', 'user');
        define('DB_PASS', 'pass');
        echo '<p align="center"><a href="http://rating.twimoldova.com/"><b>Рейтинг Twitter в Молдове</b></a></p>';
        echo "<b>Статистика</b>:<br/>";
        $conn = mysql_connect(DB_HOST, DB_USER, DB_PASS);                              
        mysql_select_db(DB_NAME, $conn);
        $sql = "SELECT COUNT(username) FROM twitter_users;";
        $rs_result = mysql_query($sql, $conn);
        $row = mysql_fetch_row($rs_result);
        echo "Всего в рейтинге: ".$row[0]."<br/>";
        //...
    ?>
</div>
But the widget not displays the data. MySQL Error:

If you run the script yourself, then the data is displayed:

Why is there a bug in the widget?