Editor->where() - escaped on false
Editor->where() - escaped on false
Flei
Posts: 10Questions: 4Answers: 0
in Bug reports
Looks like the false string does not work!
I try to make it Dynamik:
$go=array("datum","<","NOW()",false);
$editor->where( $go[0], $go[2],$go[1],$go[3] );
in log i see:
WHERE datum
< :where_0
but the NOW() have no effect!
I log with
file_put_contents( '/tmp/editor_sql', $sql."\n", FILE_APPEND );
in Database/Driver/Mysql/Query.php in end of function _prepare
I also tried:
$editor->where( function ( $q ) {
$q->where( $go[0], $go[2],$go[1],$go[3] );
} );
but shure- there is no var in the function - Error: Undefined variable: go in /.....
when i try:
$editor->where( function ( $q ) {
$q->where( 'datum', 'NOW()', '<', false );
} );
it works!
$editor->where( 'datum', 'NOW()', '<', false );
does not work also??
Any Idea?
Thanks Thomas
This discussion has been closed.
Answers
After trying hours i have now this solutions:
not the best solution but a workaround that works.
Thanks
Thomas
You are missing the
use
statement for your anonymous function. Because of PHP's unusual scoping you need to adduse ( $go )
to your anonymous function to have$go
available inside it.Allan