Exception

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND `dateto` <= ) OR (`datefrom` >= AND `dateto` <= )) ORDER BY `datefrom` DESC' at line 1

Error triggered in line 121 of /home/interma6/public_html/application/models/eventsModel.php

#0 /home/interma6/public_html/application/models/eventsModel.php(121): PDOStatement->execute()
#1 /home/interma6/public_html/application/controllers/eventsController.php(68): eventsModel->getEvents('future', 'bit.ly', 'CIM-annal-lectu...', '', 1)
#2 /home/interma6/public_html/application/controllers/eventsController.php(19): eventsController->sort('future', 'bit.ly', 'CIM-annal-lectu...', '', 1)
#3 [internal function]: eventsController->__call('future', Array)
#4 [internal function]: eventsController->future('bit.ly', 'CIM-annal-lectu...')
#5 /home/interma6/public_html/system/core/router.php(100): call_user_func_array(Array, Array)
#6 /home/interma6/public_html/system/core/router.php(20): router->route()
#7 /home/interma6/public_html/system/core/bootstrap.php(91): router->__Construct()
#8 /home/interma6/public_html/system/core/bootstrap.php(25): bootstrap->router()
#9 /home/interma6/public_html/index.php(39): bootstrap->__Construct()
#10 {main}