0

I get this error when trying to return a range of newer entries (exp:entries) in a template, and I am looking for help trying to fix whatever happened in the database, or any clue of where to look. It appears an entry ID is missing from the query. Where could this this empty entry id row in the database be? I've been looking at tables, but can't see anything obvious.

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 ', 801, 798, 3266) ORDER BY c.group_id, c.parent_id, c.cat_order' at line 6:
SELECT c.*, cp.entry_id, cg.field_html_formatting, fd.* FROM exp_categories AS c LEFT JOIN exp_category_posts AS cp ON c.cat_id = cp.cat_id LEFT JOIN exp_category_field_data AS fd ON fd.cat_id = c.cat_id LEFT JOIN exp_category_groups AS cg ON cg.group_id = c.group_id WHERE cp.entry_id IN (11950, 12021, , 801, 798, 3266) ORDER BY c.group_id, c.parent_id, c.cat_order

ee/legacy/database/drivers/mysqli/mysqli_connection.php:117

Stack Trace: Please include when reporting this error
#0 ee/legacy/database/drivers/mysqli/mysqli_driver.php(112): CI_DB_mysqli_connection->query('SELECT c.*, cp....')
#1 ee/legacy/database/DB_driver.php(270): CI_DB_mysqli_driver->_execute('SELECT c.*, cp....')
#2 ee/legacy/database/DB_driver.php(180): CI_DB_driver->simple_query('SELECT c.*, cp....')
#3 ee/legacy/models/category_model.php(35): CI_DB_driver->query('SELECT c.*, cp....')
#4 ee/legacy/libraries/relationship_parser/Tree_builder.php(164): Category_model->get_entry_categories(Array)
#5 ee/legacy/libraries/Relationships_parser.php(124): EE_relationship_tree_builder->get_parser(Object(QueryNode))
#6 ee/legacy/libraries/channel_entries_parser/components/Relationship.php(82): EE_Relationships_parser->create(Array, Array, '\n {!-- ra:00...', Array)
#7 ee/legacy/libraries/channel_entries_parser/Preparser.php(106): EE_Channel_relationship_parser->pre_process('\n {!-- ra:00...', Object(EE_Channel_preparser))
#8 ee/legacy/libraries/Channel_entries_parser.php(203): EE_Channel_preparser->__construct(Object(Channel), Object(EE_Channel_parser), Array, Array, Array)
#9 ee/legacy/libraries/Channel_entries_parser.php(169): EE_Channel_parser->pre_parser(Object(Channel), Array, Array, Array)
#10 ee/EllisLab/Addons/channel/mod.channel.php(2823): EE_Channel_parser->parse(Object(Channel), Array, Array)
#11 ee/EllisLab/Addons/channel/mod.channel.php(281): Channel->parse_channel_entries()
#12 ee/legacy/libraries/Template.php(1847): Channel->entries()
#13 ee/legacy/libraries/Template.php(1482): EE_Template->process_tags()
#14 ee/legacy/libraries/Template.php(578): EE_Template->tags()
#15 ee/legacy/libraries/Template.php(234): EE_Template->parse('{!-- ra:0000000...', false, 1, false)
#16 ee/legacy/libraries/Template.php(165): EE_Template->fetch_and_parse('', Array, false)
#17 ee/legacy/libraries/Core.php(661): EE_Template->run_template_engine('', '')
#18 ee/legacy/controllers/ee.php(63): EE_Core->generate_page()
#19 [internal function]: EE->index()
#20 ee/EllisLab/ExpressionEngine/Core/Core.php(241): call_user_func_array(Array, Array)
#21 ee/EllisLab/ExpressionEngine/Core/Core.php(110): EllisLab\ExpressionEngine\Core\Core->runController(Array)
#22 ee/EllisLab/ExpressionEngine/Boot/boot.php(151): EllisLab\ExpressionEngine\Core\Core->run(Object(EllisLab\ExpressionEngine\Core\Request))
#23 public/index.php(172): require_once('ee/...')
#23 public/index.php(172): require_once('ee/...')

The error is initially caused by another error when the STRICT_TRANS_TABLES SQL mode was on and a new entry was created. This error:

SQLSTATE[HY000]: General error: 1364 Field 'field_id_68' doesn't have a default
value:
INSERT INTO `exp_channel_data` (`entry_id`, `channel_id`, `site_id`,
`field_ft_14`, `field_ft_119`, `field_ft_127`, `field_ft_157`, `field_ft_158`,
`field_ft_159`, `field_ft_160`, `field_ft_165`, `field_ft_176`, `field_ft_181`,
`field_ft_221`, `field_ft_222`, `field_ft_264`, `field_ft_272`, `field_ft_284`,
`field_ft_288`, `field_ft_293`, `field_ft_313`, `field_ft_328`, `field_ft_329`,
`field_ft_337`, `field_ft_341`, `field_ft_342`, `field_ft_349`, `field_ft_350`,
`field_ft_351`, `field_ft_352`, `field_ft_353`, `field_ft_354`, `field_ft_355`,
`field_ft_356`, `field_id_119`) VALUES ('12029', '4', 1, 'xhtml', 'none',
'xhtml', 'none', 'none', 'none', 'none', 'xhtml', 'none', 'none', 'xhtml',
'xhtml', 'xhtml', 'xhtml', 'xhtml', 'xhtml', 'none', 'xhtml', 'xhtml', 'xhtml',
'xhtml', 'none', 'none', 'none', 'none', 'none', 'xhtml', 'none', 'xhtml',
'none', 'none', '')
ee/legacy/database/drivers/mysqli/mysqli_connection.php:117
Stack Trace: Please include when reporting this error
#0 ee/legacy/database/drivers/mysqli/mysqli_driver.php(112): CI_DB_mysqli_co
nnection->query('INSERT INTO `ex...')
#1 ee/legacy/database/DB_driver.php(270): CI_DB_mysqli_driver->_execute('INS
ERT INTO `ex...')
#2 ee/legacy/database/DB_driver.php(180): CI_DB_driver->simple_query('INSERT
INTO `ex...')
#3 ee/legacy/database/DB_active_rec.php(1371): CI_DB_driver->query('INSERT I
NTO `ex...')
#4 ee/EllisLab/ExpressionEngine/Service/Model/Query/Insert.php(75): CI_DB_ac
tive_record->insert('channel_data')
#5 ee/EllisLab/ExpressionEngine/Service/Model/Query/Update.php(99): EllisLab
\ExpressionEngine\Service\Model\Query\Insert->actOnGateway(Object(EllisLab\E
xpressionEngine\Model\Channel\Gateway\ChannelDataGateway), Object(EllisLab\E
xpressionEngine\Model\Channel\ChannelEntry))
#6 ee/EllisLab/ExpressionEngine/Service/Model/Query/Insert.php(39): EllisLab
\ExpressionEngine\Service\Model\Query\Update->doWork(Object(EllisLab\Express
ionEngine\Model\Channel\ChannelEntry))
#7 ee/EllisLab/ExpressionEngine/Service/Model/Query/Insert.php(27): EllisLab
\ExpressionEngine\Service\Model\Query\Insert->doWork(Object(EllisLab\Express
ionEngine\Model\Channel\ChannelEntry))
#8 ee/EllisLab/ExpressionEngine/Service/Model/DataStore.php(282): EllisLab\E
xpressionEngine\Service\Model\Query\Insert->run()
https://recording.music.unt.edu/control.php?/cp/addons/settings/ajw_datagrab/import 1/2
7/1/2019 Exception - ExpressionEngine
#9 ee/EllisLab/ExpressionEngine/Service/Model/DataStore.php(238): EllisLab\E
xpressionEngine\Service\Model\DataStore->runQuery('Insert', Object(EllisLab
\ExpressionEngine\Service\Model\Query\Builder))
#10 ee/EllisLab/ExpressionEngine/Service/Model/Query/Builder.php(79): EllisL
ab\ExpressionEngine\Service\Model\DataStore->insertQuery(Object(EllisLab\Exp
ressionEngine\Service\Model\Query\Builder))
#11 ee/EllisLab/ExpressionEngine/Service/Model/Model.php(355): EllisLab\Expr
essionEngine\Service\Model\Query\Builder->insert()
#12 ee/EllisLab/ExpressionEngine/Model/Content/ContentModel.php(225): EllisL
ab\ExpressionEngine\Service\Model\Model->save()
#13 user/addons/ajw_datagrab/models/datagrab_model.php(625): EllisLab\Expres
sionEngine\Model\Content\ContentModel->save()
#14 user/addons/ajw_datagrab/mcp.ajw_datagrab.php(575): Datagrab_model->do_i
mport(Object(Ajw_json), Array)
#15 [internal function]: Ajw_datagrab_mcp->import()
#16 ee/EllisLab/ExpressionEngine/Controller/Addons/Addons.php(1662): call_us
er_func_array(Array, Array)
#17 ee/EllisLab/ExpressionEngine/Controller/Addons/Addons.php(946): EllisLab
\ExpressionEngine\Controller\Addons\Addons->getModuleSettings('ajw_datagra
b', 'import', Array)
#18 [internal function]: EllisLab\ExpressionEngine\Controller\Addons\Addons-
>settings('ajw_datagrab', 'import')
#19 ee/EllisLab/ExpressionEngine/Core/Core.php(241): call_user_func_array(Ar
ray, Array)
#20 ee/EllisLab/ExpressionEngine/Core/Core.php(110): EllisLab\ExpressionEngi
ne\Core\Core->runController(Array)
#21 ee/EllisLab/ExpressionEngine/Boot/boot.php(151): EllisLab\ExpressionEngi
ne\Core\Core->run(Object(EllisLab\ExpressionEngine\Core\Request))
#22 public/control.php(147): require_once('ee/...')
#22 public/control.php(147): require_once('ee/...')

EE 5.2.2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.