'localhost', 'user'=>'', 'pass'=>'', 'db'=>''));
echo <<
Trial #1:
Experiment: Testing where fields with multiple operator types and out of order.
Code:
Result:
EOH;
$test = $db->tblproducts->get()->whereFldtype('test');
$test->wherejoin('fldtest', 'or');
$test->whereFldtest('test');
$test->where('tbltest.fld', 'value');
$test->wherejoin('tbltest.fld', '&&');
$test->limit(1,2);
$test->order('fldtest asc', 'fldtype desc');
$test->print();
echo '';
$test->varReset();
echo <<
Trial #2:
Experiment: Testing joins and out of order where fields combined.
Result:
EOH;
$test = $db->tblproducts->get()->whereFldtype('test');
$test->wherejoin('fldtest', 'or');
$test->whereFldtest('test');
$test->where('tbltest.fld', 'value');
$test->wherejoin('tbltest.fld', '&&');
$test->join('table', 'table.id', 'table1.id');
$test->joinLeft('table', 'table.id', 'table1.id');
$test->limit(1,2);
$test->order('fldtest asc', 'fldtype desc');
$test->joinRight('table', 'table.id', 'table1.id');
$test->print();
echo '';
$test->varReset();
echo <<
Trial #3:
Experiment: Testing individual select columns, and multiple where joins all out of order.
Result:
EOH;
$test = $db->tblproducts->whereFldtype('test');
$test->wherejoin('fldtest', 'or');
$test->whereFldtest('test');
$test->where('tbltest.fld', 'value');
$test->wherejoin('tbltest.fld', '&&');
$test->limit(1,2);
$test->order('fldtest asc', 'fldtype desc');
$test->get('table1.id', 'table2.*', 'table1.tid');
$test->print();
echo '';
$test->varReset();
echo <<
Trial #4:
Experiment: Supplying insufficient parameters
Result:
EOH;
$test = $db->tblproducts->whereFldtype('test');
$test->join('table', 'table.id');
$test->wherejoin('fldtest', 'or');
$test->whereFldtest('test');
$test->where('tbltest.fld', 'value');
$test->wherejoin('tbltest.fld', '&&');
$test->limit(1,2);
$test->order('fldtest asc', 'fldtype desc');
$test->get('table1.id', 'table2.*', 'table1.tid');
$test->print();
echo '';
$test->varReset();
echo <<
Trial #5:
Experiment: Getting more custom with the where parameters.
Result:
EOH;
$test = $db->tblproducts;
$test->whereFldimageLike('/usr/images');
$test->where('(fldTest = \'test\' && fldTimestamp < NOW() - 3600)');
$test->get('table1.id', 'table2.*', 'table1.tid');
$test->print();
echo '';
$test->varReset();
echo <<
Trial #6:
Experiment: Getting more custom with the where parameters.
Result:
EOH;
$test = $db->tblproducts;
$test->whereFldimageLike('/usr/images');
$test->where('(fldTest = \'test\' && fldTimestamp < NOW() - 3600)');
$test->get('table1.id', 'table2.*', 'table1.tid');
$test->print();
echo '';
?>
output:
Trial #1:
Experiment: Testing where fields with multiple operator types and out of order.
Code:
Result:
SELECT * FROM tblproducts WHERE fldtype = Array OR fldtest = Array && tbltest.fld = 'value' ORDER BY fldtest asc, fldtype desc LIMIT 1, 2
Trial #2:
Experiment: Testing joins and out of order where fields combined.
Result:
SELECT * FROM tblproducts JOIN table ON table.id = table1.id LEFT JOIN table ON table.id = table1.id RIGHT JOIN table ON table.id = table1.id WHERE fldtype = Array OR fldtest = Array && tbltest.fld = 'value' ORDER BY fldtest asc, fldtype desc LIMIT 1, 2
Trial #3:
Experiment: Testing individual select columns, and multiple where joins all out of order.
Result:
SELECT table1.id, table2.*, table1.tid FROM tblproducts WHERE fldtype = Array OR fldtest = Array && tbltest.fld = 'value' ORDER BY fldtest asc, fldtype desc LIMIT 1, 2
Trial #4:
Experiment: Supplying insufficient parameters
Result:
MyIO Exception Error
Message: Insufficient parameters for JOIN statement. Supplied 2 expected 3.
Stack Trace: #0 [internal function]: MyIODriver->__call('join', Array) #1 C:\Apache\htdocs\myio\index.php(86): MyIODriver->join('table', 'table.id') #2 {main}
SELECT table1.id, table2.*, table1.tid FROM tblproducts WHERE fldtype = Array OR fldtest = Array && tbltest.fld = 'value' ORDER BY fldtest asc, fldtype desc LIMIT 1, 2
Trial #5:
Experiment: Getting more custom with the where parameters.
Result:
SELECT table1.id, table2.*, table1.tid FROM tblproducts WHERE fldimage LIKE '%/usr/images%' AND (fldTest = 'test' && fldTimestamp < NOW() - 3600)
Trial #6:
Experiment: Getting more custom with the where parameters.
Result:
SELECT table1.id, table2.*, table1.tid FROM tblproducts WHERE fldimage LIKE '%/usr/images%' AND (fldTest = 'test' && fldTimestamp < NOW() - 3600)