Undefined variables and persistence problems

My other boss says that my connection isn’t persistent

And I have always had a problem with the message below

I have upgraded several times and have tried debugging the program without avail.

Has anyone seen these problems, or does a programmer recognize these issues.

I am connecting to CodeIgniter and have setup the database.php according to the instructions.

Thanks,

David

ERROR - 2014-05-02 09:51:48 → Severity: Warning → Missing argument 1 for DataWrapper::__construct(), called in /home/dgriffis/svn/vrb2/html_vrb2/dhtmlx/connector/base_connector.php on line 508 and defined /home/dgriffis/svn/vrb2/html_vrb2/dhtmlx/connector/db_common.php 517
ERROR - 2014-05-02 09:51:48 → Severity: Warning → Missing argument 2 for DataWrapper::__construct(), called in /home/dgriffis/svn/vrb2/html_vrb2/dhtmlx/connector/base_connector.php on line 508 and defined /home/dgriffis/svn/vrb2/html_vrb2/dhtmlx/connector/db_common.php 517
ERROR - 2014-05-02 09:51:48 → Severity: Notice → Undefined variable: config /home/dgriffis/svn/vrb2/html_vrb2/dhtmlx/connector/db_common.php 518
ERROR - 2014-05-02 09:51:48 → Severity: Notice → Undefined variable: connection /home/dgriffis/svn/vrb2/html_vrb2/dhtmlx/connector/db_common.php 519

Please share the code snippet that used for connector initialization

Here it is

I have concealed certain for security/disclosure reasons

Thanks so much,

-D

48 $active_group = ‘default’;
49 $active_record = TRUE;
50
51 $db[‘default’][‘hostname’] = ‘<>’;
52 //$db[‘default’][‘dsn’] = ‘mysql:host=<;dbname=<>:port=3306’;
53 $db[‘default’][‘username’] = ‘<>’;
54 $db[‘default’][‘password’] = ‘<>’;
55 $db[‘default’][‘database’] = ‘<>’;
56 $db[‘default’][‘dbdriver’] = ‘mysqli’;
57 //$db[‘default’][‘dbdriver’] = ‘pdo’;
58 $db[‘default’][‘dbprefix’] = ‘’;
59 $db[‘default’][‘pconnect’] = TRUE;
60 $db[‘default’][‘db_debug’] = TRUE;
61 $db[‘default’][‘cache_on’] = FALSE;
62 $db[‘default’][‘cachedir’] = ‘’;
63 $db[‘default’][‘char_set’] = ‘utf8’;
64 $db[‘default’][‘dbcollat’] = ‘utf8_general_ci’;
65 $db[‘default’][‘swap_pre’] = ‘’;
66 $db[‘default’][‘autoinit’] = TRUE;
67 $db[‘default’][‘stricton’] = FALSE;
68
69
70 /* End of file database.php /
71 /
Location: ./application/config/database.php */

Can you post the exact line where new Connector called

Above error can occurs if

  • you have empty|invalid connector object as parameter of Connector constructor
  • you can have valid db type, but not providing the valid db type ( second parameter of Connector constructor )

Here it is

Thanks,

David

public function data()
{
$this->load->database();

    $connector = new SchedulerConnector($this->db, "phpCI");

    $connector->configure("events", "event_id", "<<I have fields here>>");
    $connector->useModel($this->event_model);//applies the model
    $connector->render();
}

Please try to update connector file with the attached one
We will include the same fix in next official update as well.
db_common_fix.zip (7.7 KB)

Thank you

-David

It worked!!!

Bravo guys. No more errors in the log.

-D

However, I’m not establishing a persistent connection which could be an issue.

-D

[root@cad-david-dev application]# netstat -an | grep 3306
tcp 0 0 151.132.36.155:45382 151.132.36.86:3306 TIME_WAIT
tcp 0 0 151.132.36.155:45386 151.132.36.86:3306 TIME_WAIT
tcp 0 0 151.132.36.155:45383 151.132.36.86:3306 TIME_WAIT

Pardon moi.

Looks like if you use mysql instead of mysqli a persistent connection is established so persistance isn’t a DHTMLX issue, even though I will have to figure it out.

Thanks,

David

codeigniter database.php

$db[‘default’][‘dbdriver’] = ‘mysqli’;
//$db[‘default’][‘dbdriver’] = ‘mysql’;