-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Phalcon and Oracle reserved words bug #11056
Comments
One of the possible way is https://docs.phalconphp.com/en/latest/reference/phql.html#using-raw-sql You will get the same object as after execution Or you can bind current time from php $conditions = "bannerType = :bannerType: and startTime > :sysdate:";
$parameters = array('bannerType'=>$bannerType, "sysdate" => <currentTimeStamp>);
$banners = Banner::find(array($conditions,"bind" => $parameters)); |
Thank you, raw SQL might really be an option. What does this syntax mean ? Parse error: syntax error, unexpected '<' in /home/var/www/html/v1/app/controllers/BannerController.php on line 53 |
Probably you've used my example without changing I do not know what is the format used in Oracle's In MySQL there are 2 general formats So in MySQL I'd used that syntax $parameters = array('bannerType'=>$bannerType, "sysdate" => time()); //CURENT_TIMESTAMP
//OR
$parameters = array('bannerType'=>$bannerType, "sysdate" => date('Y-m-d H:i:s')); //current date time |
Phalcon does not support Oracle. Refer to #12008 |
Phalcon 2.0.3 and Oracle 12c
Phalcon gives me the error below when I need to compare date column with SYSDATE. How to worlaround it?
$conditions = "bannerType = :bannerType: and startTime > sysdate";
$parameters = array('bannerType'=>$bannerType);
$banners = Banner::find(array($conditions,"bind" => $parameters));
Column 'sysdate' doesn't belong to any of the selected models (1), when preparing: SELECT [Vokuro\Models\Banner].* FROM [Vokuro\Models\Banner] WHERE bannerType = :bannerType: and startTime > sysdate and bannerStatus = :bannerStatus:
#0 [internal function]: Phalcon\Mvc\Model\Query->_getQualified(Array)
#1 [internal function]: Phalcon\Mvc\Model\Query->_getExpression(Array, true)
#2 [internal function]: Phalcon\Mvc\Model\Query->_getExpression(Array, true)
#3 [internal function]: Phalcon\Mvc\Model\Query->_getExpression(Array, true)
#4 [internal function]: Phalcon\Mvc\Model\Query->_getExpression(Array)
#5 [internal function]: Phalcon\Mvc\Model\Query->_prepareSelect()
#6 [internal function]: Phalcon\Mvc\Model\Query->parse()
#7 [internal function]: Phalcon\Mvc\Model\Query->execute(Array, NULL)
#8 /home/var/www/html/v1/app/controllers/BannerController.php(92): Phalcon\Mvc\Model::find(Array)
#9 [internal function]: Vokuro\Controllers\BannerController->getAllAction()
#10 [internal function]: Phalcon\Dispatcher->dispatch()
#11 /home/var/www/html/v1/public/index.php(44): Phalcon\Mvc\Application->handle()
#12 {main}
The text was updated successfully, but these errors were encountered: