0

I am currently working with Joomla. I want to insert a new row into #__content_types table, but there is a column named table that is currently giving me errors.

How do I insert the data despite the name of the column 'table'?

INSERT INTO #__content_types(type_id, type_title, type_alias, table, field_mappings)
VALUES
('14','SVG Image','com_view_vv.form','{"special":{"dbtable":"#__table","key":"id","type": "Corecontent","prefix":"JTable","config":"array()"},"common":{"dbtable": "#__ucm_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}', '{"common": {"core_content_item_id":"id","core_title":"name","core_alais": "alias"},"special":{"imptotal":"imptotal","impmade":"impmade","clicks": "clicks","clickurl": "clickurl","custombannercode":"custombannercode","cid":"cid","purchase_type": "purchase_type","track_impressions":"track_impressions","track_clicks":"track_clicks"}}');
rancper
  • 35
  • 6
  • 1
    If you want to have a reserved word as column name, you have to specify it as a delimited identifer, like `"table"`. – jarlh Nov 20 '20 at 20:52
  • That worked, thank you! – rancper Nov 20 '20 at 20:54
  • If you are doing Joomla development, please join [joomla.se] Stack Exchange -- a dedicated community with volunteers who have specialized expertise with Joomla and its extensions. When you have a Joomla question, please post it on JSE. Depending on how/where you are executing this sql, we may be able to offer you further advice/insights about best practice. – mickmackusa Nov 21 '20 at 11:20
  • coming to this question 3 years later, instead of `"table"` some environments require back ticks to work, `\`table\`` – TKoL May 17 '23 at 08:41

0 Answers0