Author Topic: mysql select, Error No. [500]  (Read 6224 times)

Offline cubeuser

  • Newbie
  • *
  • Posts: 1
mysql select, Error No. [500]
« on: December 01, 2009, 01:56:44 AM »
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:

Code: [Select]

SERVICE CURRENTLY NOT AVAILABLE!
Error No. [500]

How it to clean an error?

Offline cubeuser

  • Newbie
  • *
  • Posts: 1
mysql select, Error No. [500]
« Reply #1 on: December 02, 2009, 02:43:14 AM »
Code: [Select]

<?

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]