Roundcube Community Forum

 

mysql select, Error No. [500]

Started by cubeuser, December 01, 2009, 01:56:44 AM

Previous topic - Next topic

cubeuser

I write a plug-in but there was a problem

At a conclusion of inquiry SELECT in a place with inquiry there is an error:


SERVICE CURRENTLY NOT AVAILABLE!
Error No. [500]

How it to clean an error?

cubeuser


<?

class test extends rcube_plugin
{

function init()
        {
        $rcmail = rcmail::get_instance();
                $this->register_action('plugin.test', array($this, 'infostep'));
                $this->include_script('test.js');

        }

function infostep()
        {
        $this->register_handler('plugin.body', array($this, 'testhtml'));
        $rcmail = rcmail::get_instance();
        $rcmail->output->send('plugin');
        }


function testhtml()
{

$rcmail = rcmail::get_instance();

$db = new rcube_mdb2('mysql://root:8etd@localhost/test','', FALSE);
$db->db_connect('w');
$sql_result = $db->query('SELECT * FROM clients');

$table = new html_table(array('cols' => 1));
  while ($sql_result && ($sql_arr = $db->fetch_assoc($sql_result))) {

$table->add('',Q($sql_arr[name]));
}
return $table->show();

}

}
?>



what is wrong with the plugin, why the error?

SERVICE CURRENTLY NOT AVAILABLE!
Error No. [500]