Hello, I have been using this library for years. Exceptional! Today I was debugging some code and I managed to reproduce something that IMO shouldn't happen:
$myId = Db::instance()->rawQueryValue( 'select id from users where users.id = ? limit 1 ', [ 262 ] ); die(print_r($myId));
Guess what this outputs.... An array! Whilst it should output a single value, shouldn't it?
Array ( [0] => 262 ) 1
EDIT: I found out that the issue is adding a space, or a backspace after "limit 1" at the end of the query. I think this can be fixed with an rtrim()
Hello, I have been using this library for years. Exceptional! Today I was debugging some code and I managed to reproduce something that IMO shouldn't happen:
$myId = Db::instance()->rawQueryValue( 'select id from users where users.id = ? limit 1 ', [ 262 ] ); die(print_r($myId));
Guess what this outputs.... An array! Whilst it should output a single value, shouldn't it?
Array ( [0] => 262 ) 1
EDIT: I found out that the issue is adding a space, or a backspace after "limit 1" at the end of the query. I think this can be fixed with an
rtrim()