+// if (preg_match("/^select/i",$sql) && (rand(0,1000)>MASTER2SLAVE) && $this->Master) {
+// every select query goes to onyx + opraveny regexp, aby matchoval vnorene selecty (br)
+ if (preg_match('/^\(?select/i',$sql) && $this->Master) {
+ $this->_linkId = false;
+ $this->connect(SLAVE_HOST,SLAVE_USER,SLAVE_PASS,SLAVE_DATABASE);
+ $this->Master = false;
+
+ }