Empty resultset when using Phalcon\Mvc\Model\Query\Builder



85.3k

Hi, What version are you using?



85.3k

Can you check if a SELECT COUNT() is being generated for the SELECT FROM RADIO_PACKAGE?

If I understood you correctly, it's sql log for "$packages = Package::find();"

[Fri, 21 Jun 13 19:03:46 +0400][INFO] SELECT CASE WHEN COUNT(*) > 0 THEN 1 ELSE 0 END RET FROM ALL_TABLES WHERE TABLE_NAME='RADIO_PACKAGE' AND OWNER = 'RADIO' [Fri, 21 Jun 13 19:03:46 +0400][INFO] SELECT TC.COLUMN_NAME, TC.DATA_TYPE, TC.DATA_LENGTH, TC.DATA_PRECISION, TC.DATA_SCALE, TC.NULLABLE, C.CONSTRAINT_TYPE, TC.DATA_DEFAULT, CC.POSITION FROM ALL_TAB_COLUMNS TC LEFT JOIN (ALL_CONS_COLUMNS CC JOIN ALL_CONSTRAINTS C ON (CC.CONSTRAINT_NAME = C.CONSTRAINT_NAME AND CC.TABLE_NAME = C.TABLE_NAME AND CC.OWNER = C.OWNER AND C.CONSTRAINT_TYPE = 'P')) ON TC.TABLE_NAME = CC.TABLE_NAME AND TC.COLUMN_NAME = CC.COLUMN_NAME WHERE TC.TABLE_NAME = 'RADIO_PACKAGE' AND TC.OWNER = 'RADIO' ORDER BY TC.COLUMN_ID [Fri, 21 Jun 13 19:03:46 +0400][INFO] SELECT "RADIO_PACKAGE"."RADIO_PACKAGE_ID", "RADIO_PACKAGE"."RADIO_PACKAGE_TITLE", "RADIO_PACKAGE"."RADIO_PACKAGE_BODY_ORIG", "RADIO_PACKAGE"."RADIO_PACKAGE_BODY_REWRITE", "RADIO_PACKAGE"."RADIO_PACKAGE_ANNOUNCE", "RADIO_PACKAGE"."RADIO_PACKAGE_STATUS_ID", "RADIO_PACKAGE"."RADIO_PACKAGE_FILENAME", "RADIO_PACKAGE"."RADIO_PACKAGE_DATE_CREATED", "RADIO_PACKAGE"."RADIO_PACKAGE_DATE_MODIFIED", "RADIO_PACKAGE"."RADIO_PACKAGE_AIR_START_DATE", "RADIO_PACKAGE"."RADIO_PACKAGE_AIR_STOP_DATE", "RADIO_PACKAGE"."RADIO_PACKAGE_AIR_PERIOD", "RADIO_PACKAGE"."RADIO_PACKAGE_DISCLAIMER", "RADIO_PACKAGE"."RADIO_PACKAGE_COMMENT", "RADIO_PACKAGE"."RADIO_HOTDOG_ID", "RADIO_PACKAGE"."RADIO_USER", "RADIO_PACKAGE"."RADIO_PACKAGE_IS_ACTIVE" FROM "RADIO"."RADIO_PACKAGE



85.3k

Can you try compiling again from the 1.2.0 branch?, I added a fix for this

NOTICE: Phalcon\Db\Result\Pdo::numRows(): Undefined index: 0

Stacktrace (most recent call first):

File "/home/mingalevme/projects/radio/app/controllers/PlaylistController.php", line 12, in {closure} $rows = Package::find(); File "/home/mingalevme/projects/radio/app/controllers/PlaylistController.php", line 12, in indexAction $rows = Package::find(); File "/home/mingalevme/projects/radio/public/index.php", line 300, in null $application->handle()->send();