Write query in theme file.

Permalink
I am new in concrete5. I want to add one condition in theme file that is if status is true then my code will run. But problem. I am unable to create database instance on theme header.php file.
below my theme path and here i want to create db instance and write query.

/public_html/packages/theme_stucco/themes/stucco/inc


Please help me.
thanks in advance.

 
shahroq replied on at Permalink Reply
shahroq
$db = Database::connection();           
$db->executeQuery("INSERT INTO `Test` (`title`) VALUES ('sss');");

You can also check the documentation:
https://documentation.concrete5.org/developers/database-management/a...
priteshmahajan replied on at Permalink Reply
Thanks you very much for your support.