-- PPPHP Community — content seed (PII-free). Statements separated by `-- @@`.
-- @@
CREATE TABLE IF NOT EXISTS `qa_categories` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `slug` varchar(80) NOT NULL,
  `name` varchar(120) NOT NULL,
  `description` text,
  `sort_order` int NOT NULL DEFAULT '0',
  `question_count` int NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_qa_categories_slug` (`slug`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- @@
CREATE TABLE IF NOT EXISTS `qa_tags` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `slug` varchar(80) NOT NULL,
  `name` varchar(120) NOT NULL,
  `description` text,
  `usage_count` int NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_qa_tags_slug` (`slug`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- @@
CREATE TABLE IF NOT EXISTS `qa_users` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `sso_subject` varchar(64) DEFAULT NULL,
  `username` varchar(64) NOT NULL,
  `password` varchar(255) DEFAULT NULL,
  `display_name` varchar(120) NOT NULL DEFAULT '',
  `email` varchar(190) NOT NULL DEFAULT '',
  `avatar_url` varchar(400) NOT NULL DEFAULT '',
  `bio` text,
  `website` varchar(400) NOT NULL DEFAULT '',
  `reputation` int NOT NULL DEFAULT '0',
  `role` varchar(16) NOT NULL DEFAULT 'member',
  `status` varchar(16) NOT NULL DEFAULT 'active',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `last_seen_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_qa_users_username` (`username`),
  UNIQUE KEY `uq_qa_users_sso` (`sso_subject`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- @@
CREATE TABLE IF NOT EXISTS `qa_questions` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `slug` varchar(200) NOT NULL DEFAULT '',
  `title` varchar(300) NOT NULL,
  `body_md` text,
  `author_id` bigint unsigned DEFAULT NULL,
  `category_id` bigint unsigned DEFAULT NULL,
  `status` varchar(16) NOT NULL DEFAULT 'open',
  `duplicate_of_id` bigint unsigned DEFAULT NULL,
  `view_count` int NOT NULL DEFAULT '0',
  `vote_score` int NOT NULL DEFAULT '0',
  `answer_count` int NOT NULL DEFAULT '0',
  `accepted_answer_id` bigint unsigned DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `last_activity_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `deleted_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `ix_qa_q_activity` (`last_activity_at`),
  KEY `ix_qa_q_category` (`category_id`),
  KEY `fk_qa_q_author` (`author_id`),
  KEY `fk_qa_accepted_answer` (`accepted_answer_id`),
  FULLTEXT KEY `ft_qa_q` (`title`,`body_md`),
  CONSTRAINT `fk_qa_accepted_answer` FOREIGN KEY (`accepted_answer_id`) REFERENCES `qa_answers` (`id`) ON DELETE SET NULL,
  CONSTRAINT `fk_qa_q_author` FOREIGN KEY (`author_id`) REFERENCES `qa_users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `fk_qa_q_category` FOREIGN KEY (`category_id`) REFERENCES `qa_categories` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- @@
CREATE TABLE IF NOT EXISTS `qa_answers` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `question_id` bigint unsigned NOT NULL,
  `author_id` bigint unsigned DEFAULT NULL,
  `body_md` text,
  `vote_score` int NOT NULL DEFAULT '0',
  `is_accepted` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `deleted_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `ix_qa_a_question` (`question_id`),
  KEY `fk_qa_a_author` (`author_id`),
  FULLTEXT KEY `ft_qa_a` (`body_md`),
  CONSTRAINT `fk_qa_a_author` FOREIGN KEY (`author_id`) REFERENCES `qa_users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `fk_qa_a_question` FOREIGN KEY (`question_id`) REFERENCES `qa_questions` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- @@
CREATE TABLE IF NOT EXISTS `qa_question_tags` (
  `question_id` bigint unsigned NOT NULL,
  `tag_id` bigint unsigned NOT NULL,
  PRIMARY KEY (`question_id`,`tag_id`),
  KEY `fk_qa_qt_tag` (`tag_id`),
  CONSTRAINT `fk_qa_qt_question` FOREIGN KEY (`question_id`) REFERENCES `qa_questions` (`id`) ON DELETE CASCADE,
  CONSTRAINT `fk_qa_qt_tag` FOREIGN KEY (`tag_id`) REFERENCES `qa_tags` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- @@
INSERT INTO `qa_categories` (`id`,`slug`,`name`,`description`,`sort_order`,`question_count`) VALUES ('1','getting-started','Getting Started','Setup, your first app, and the basics','1','1');
-- @@
INSERT INTO `qa_categories` (`id`,`slug`,`name`,`description`,`sort_order`,`question_count`) VALUES ('2','databases','Databases & Connections','Connecting, modelling, and multi-database','2','0');
-- @@
INSERT INTO `qa_categories` (`id`,`slug`,`name`,`description`,`sort_order`,`question_count`) VALUES ('3','customising','Events & Custom Code','Custom PHP/JS, lifecycle hooks, and logic','7','0');
-- @@
INSERT INTO `qa_categories` (`id`,`slug`,`name`,`description`,`sort_order`,`question_count`) VALUES ('4','designer-pages','Designer & Pages','Building lists, forms, and screens','3','0');
-- @@
INSERT INTO `qa_categories` (`id`,`slug`,`name`,`description`,`sort_order`,`question_count`) VALUES ('5','themes-styling','Themes & Styling','Look, layout, and branding','4','0');
-- @@
INSERT INTO `qa_categories` (`id`,`slug`,`name`,`description`,`sort_order`,`question_count`) VALUES ('6','auth-security','Authentication & Security','Login, roles, and permissions','5','0');
-- @@
INSERT INTO `qa_categories` (`id`,`slug`,`name`,`description`,`sort_order`,`question_count`) VALUES ('7','deployment-hosting','Deployment & Hosting','Publishing your generated app','6','0');
-- @@
INSERT INTO `qa_categories` (`id`,`slug`,`name`,`description`,`sort_order`,`question_count`) VALUES ('8','plugins-fields','Plugins & Field Controls','Extending fields and behaviour','8','0');
-- @@
INSERT INTO `qa_categories` (`id`,`slug`,`name`,`description`,`sort_order`,`question_count`) VALUES ('9','troubleshooting','Troubleshooting','Errors, bugs, and how to fix them','9','0');
-- @@
INSERT INTO `qa_categories` (`id`,`slug`,`name`,`description`,`sort_order`,`question_count`) VALUES ('10','ideas-feedback','Ideas & Feedback','Feature requests and discussion','10','0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('1','oracle','oracle',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('2','postgresql','postgresql',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('3','deployment','deployment',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('4','security','security',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('5','customization','customization',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('6','no-code','no-code',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('7','low-code','low-code',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('8','rad','rad',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('9','database','database',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('10','connection','connection',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('11','databases','databases',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('12','architecture','architecture',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('13','csv','csv',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('14','excel','excel',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('15','import','import',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('16','export','export',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('17','designer','designer',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('18','forms','forms',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('19','master-detail','master-detail',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('20','relationships','relationships',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('21','dashboard','dashboard',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('22','charts','charts',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('23','kpi','kpi',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('24','calendar','calendar',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('25','pdf','pdf',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('26','themes','themes',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('27','dark-mode','dark-mode',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('28','styling','styling',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('29','permissions','permissions',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('30','rbac','rbac',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('31','authentication','authentication',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('32','login','login',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('33','existing-table','existing-table',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('34','2fa','2fa',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('35','row-level-security','row-level-security',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('36','encryption','encryption',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('37','shared-hosting','shared-hosting',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('38','php','php',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('39','events','events',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('40','custom-code','custom-code',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('41','plugins','plugins',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('42','field-controls','field-controls',NULL,'0');
-- @@
INSERT INTO `qa_users` (`id`,`sso_subject`,`username`,`password`,`display_name`,`email`,`avatar_url`,`bio`,`website`,`reputation`,`role`,`status`,`created_at`,`last_seen_at`) VALUES ('1',NULL,'admin','','Admin','','',NULL,'','0','superadmin','active','2026-08-05 13:47:30',NULL);
-- @@
INSERT INTO `qa_users` (`id`,`sso_subject`,`username`,`password`,`display_name`,`email`,`avatar_url`,`bio`,`website`,`reputation`,`role`,`status`,`created_at`,`last_seen_at`) VALUES ('5',NULL,'ppphp-team','','PPPHP Team','','',NULL,'','100','admin','active','2026-08-05 19:58:52',NULL);
-- @@
INSERT INTO `qa_questions` (`id`,`slug`,`title`,`body_md`,`author_id`,`category_id`,`status`,`duplicate_of_id`,`view_count`,`vote_score`,`answer_count`,`accepted_answer_id`,`created_at`,`updated_at`,`last_activity_at`,`deleted_at`) VALUES ('1','do-i-need-to-know-how-to-code','Do I need to know how to code to build an app with PPPHP?','I want to build a small business app. Is coding required, or is it all visual?','5','1','open',NULL,'9','5','1','1','2026-08-05 19:58:52','2026-08-05 19:58:52','2026-08-05 19:58:52',NULL);
-- @@
INSERT INTO `qa_questions` (`id`,`slug`,`title`,`body_md`,`author_id`,`category_id`,`status`,`duplicate_of_id`,`view_count`,`vote_score`,`answer_count`,`accepted_answer_id`,`created_at`,`updated_at`,`last_activity_at`,`deleted_at`) VALUES ('2','connect-ppphp-to-an-oracle-database','How do I connect PPPHP to an Oracle database?','We run **Oracle**. How do I point a PPPHP project at it and what driver is needed?','5','2','open',NULL,'4','8','1','2','2026-08-05 19:58:52','2026-08-05 19:58:52','2026-08-05 19:58:52',NULL);
-- @@
INSERT INTO `qa_questions` (`id`,`slug`,`title`,`body_md`,`author_id`,`category_id`,`status`,`duplicate_of_id`,`view_count`,`vote_score`,`answer_count`,`accepted_answer_id`,`created_at`,`updated_at`,`last_activity_at`,`deleted_at`) VALUES ('3','which-databases-does-ppphp-support','Which databases does PPPHP support?','Trying to pick a database for a new project — what does PPPHP work with?','5','2','open',NULL,'0','6','1','3','2026-08-05 19:58:52','2026-08-05 19:58:52','2026-08-05 19:58:52',NULL);
-- @@
INSERT INTO `qa_questions` (`id`,`slug`,`title`,`body_md`,`author_id`,`category_id`,`status`,`duplicate_of_id`,`view_count`,`vote_score`,`answer_count`,`accepted_answer_id`,`created_at`,`updated_at`,`last_activity_at`,`deleted_at`) VALUES ('4','where-can-i-deploy-the-generated-app','Where can I deploy the app PPPHP generates?','Can the output run on cheap shared hosting, or do I need something special?','5','1','open',NULL,'0','4','1','4','2026-08-05 19:58:52','2026-08-05 19:58:52','2026-08-05 19:58:52',NULL);
-- @@
INSERT INTO `qa_questions` (`id`,`slug`,`title`,`body_md`,`author_id`,`category_id`,`status`,`duplicate_of_id`,`view_count`,`vote_score`,`answer_count`,`accepted_answer_id`,`created_at`,`updated_at`,`last_activity_at`,`deleted_at`) VALUES ('5','can-i-add-custom-php-and-javascript','Can I add custom PHP and JavaScript to a generated app?','The built-in options are great but I need a bit of custom logic. Is that possible?','5','3','open',NULL,'0','3','1','5','2026-08-05 19:58:52','2026-08-05 19:58:52','2026-08-05 19:58:52',NULL);
-- @@
INSERT INTO `qa_questions` (`id`,`slug`,`title`,`body_md`,`author_id`,`category_id`,`status`,`duplicate_of_id`,`view_count`,`vote_score`,`answer_count`,`accepted_answer_id`,`created_at`,`updated_at`,`last_activity_at`,`deleted_at`) VALUES ('7','is-ppphp-no-code-or-low-code','Is PPPHP a no-code or low-code app builder?','I want to build a small business database app but I am not a developer. Is PPPHP no-code, or do I have to write code?','5','1','open',NULL,'0','14','1','9','2026-07-15 21:24:11','2026-08-05 21:24:11','2026-07-15 21:24:11',NULL);
-- @@
INSERT INTO `qa_questions` (`id`,`slug`,`title`,`body_md`,`author_id`,`category_id`,`status`,`duplicate_of_id`,`view_count`,`vote_score`,`answer_count`,`accepted_answer_id`,`created_at`,`updated_at`,`last_activity_at`,`deleted_at`) VALUES ('8','connect-ppphp-to-a-postgresql-database','How do I connect PPPHP to a PostgreSQL database?','We run **PostgreSQL**. How do I point a PPPHP project at it and is the generated SQL correct for Postgres?','5','2','open',NULL,'0','11','1','10','2026-07-17 21:24:11','2026-08-05 21:24:11','2026-07-17 21:24:11',NULL);
-- @@
INSERT INTO `qa_questions` (`id`,`slug`,`title`,`body_md`,`author_id`,`category_id`,`status`,`duplicate_of_id`,`view_count`,`vote_score`,`answer_count`,`accepted_answer_id`,`created_at`,`updated_at`,`last_activity_at`,`deleted_at`) VALUES ('9','use-multiple-databases-in-one-project','Can one PPPHP project use more than one database?','My app spans two databases. Can a single PPPHP project connect to both?','5','2','open',NULL,'0','6','1','11','2026-07-19 21:24:11','2026-08-05 21:24:11','2026-07-19 21:24:11',NULL);
-- @@
INSERT INTO `qa_questions` (`id`,`slug`,`title`,`body_md`,`author_id`,`category_id`,`status`,`duplicate_of_id`,`view_count`,`vote_score`,`answer_count`,`accepted_answer_id`,`created_at`,`updated_at`,`last_activity_at`,`deleted_at`) VALUES ('10','import-a-csv-or-excel-file-into-a-table','How do I import a CSV or Excel file into a table?','I have a spreadsheet of products. How do users load that into a PPPHP table, and can they export too?','5','2','open',NULL,'0','9','1','12','2026-07-21 21:24:11','2026-08-05 21:24:11','2026-07-21 21:24:11',NULL);
-- @@
INSERT INTO `qa_questions` (`id`,`slug`,`title`,`body_md`,`author_id`,`category_id`,`status`,`duplicate_of_id`,`view_count`,`vote_score`,`answer_count`,`accepted_answer_id`,`created_at`,`updated_at`,`last_activity_at`,`deleted_at`) VALUES ('11','build-add-and-edit-forms-without-coding','How do I build add and edit forms without coding?','Do I have to hand-write HTML forms for each table, or does PPPHP generate them?','5','4','open',NULL,'0','12','1','13','2026-07-22 21:24:11','2026-08-05 21:24:11','2026-07-22 21:24:11',NULL);
-- @@
INSERT INTO `qa_questions` (`id`,`slug`,`title`,`body_md`,`author_id`,`category_id`,`status`,`duplicate_of_id`,`view_count`,`vote_score`,`answer_count`,`accepted_answer_id`,`created_at`,`updated_at`,`last_activity_at`,`deleted_at`) VALUES ('12','show-related-records-master-detail-on-a-page','How do I show related records (master–detail) on a page?','I have Orders and Order Items. How do I show an order\'s line items on the order page?','5','4','open',NULL,'0','13','1','14','2026-07-23 21:24:11','2026-08-05 21:24:11','2026-07-23 21:24:11',NULL);
-- @@
INSERT INTO `qa_questions` (`id`,`slug`,`title`,`body_md`,`author_id`,`category_id`,`status`,`duplicate_of_id`,`view_count`,`vote_score`,`answer_count`,`accepted_answer_id`,`created_at`,`updated_at`,`last_activity_at`,`deleted_at`) VALUES ('13','build-a-dashboard-with-charts-and-kpis','Can I build a dashboard with charts and KPI tiles?','I want a landing dashboard with totals and a couple of charts. Is that possible without a charting library?','5','4','open',NULL,'1','15','1','15','2026-07-24 21:24:11','2026-08-05 21:24:11','2026-07-24 21:24:11',NULL);
-- @@
INSERT INTO `qa_questions` (`id`,`slug`,`title`,`body_md`,`author_id`,`category_id`,`status`,`duplicate_of_id`,`view_count`,`vote_score`,`answer_count`,`accepted_answer_id`,`created_at`,`updated_at`,`last_activity_at`,`deleted_at`) VALUES ('14','create-a-calendar-page-from-a-date-field','How do I turn a date field into a calendar view?','My table has an event date. Can PPPHP show those records on a calendar?','5','4','open',NULL,'0','8','1','16','2026-07-25 21:24:11','2026-08-05 21:24:11','2026-07-25 21:24:11',NULL);
-- @@
INSERT INTO `qa_questions` (`id`,`slug`,`title`,`body_md`,`author_id`,`category_id`,`status`,`duplicate_of_id`,`view_count`,`vote_score`,`answer_count`,`accepted_answer_id`,`created_at`,`updated_at`,`last_activity_at`,`deleted_at`) VALUES ('15','let-users-download-a-record-as-pdf','How do I let users download a record as a PDF?','Customers want a printable PDF of each invoice record. How do I add that?','5','4','open',NULL,'0','7','1','17','2026-07-26 21:24:11','2026-08-05 21:24:11','2026-07-26 21:24:11',NULL);
-- @@
INSERT INTO `qa_questions` (`id`,`slug`,`title`,`body_md`,`author_id`,`category_id`,`status`,`duplicate_of_id`,`view_count`,`vote_score`,`answer_count`,`accepted_answer_id`,`created_at`,`updated_at`,`last_activity_at`,`deleted_at`) VALUES ('16','add-dark-mode-or-a-custom-theme-to-my-app','How do I add dark mode or a custom theme to my app?','Can I change the colours / add a dark theme without editing CSS everywhere?','5','5','open',NULL,'0','10','1','18','2026-07-27 21:24:11','2026-08-05 21:24:11','2026-07-27 21:24:11',NULL);
-- @@
INSERT INTO `qa_questions` (`id`,`slug`,`title`,`body_md`,`author_id`,`category_id`,`status`,`duplicate_of_id`,`view_count`,`vote_score`,`answer_count`,`accepted_answer_id`,`created_at`,`updated_at`,`last_activity_at`,`deleted_at`) VALUES ('17','set-up-role-based-access-control','How do I set up role-based permissions (RBAC)?','Different staff should have different access — how do I control who can view/add/edit/delete each table?','5','6','open',NULL,'0','16','1','19','2026-07-28 21:24:11','2026-08-05 21:24:11','2026-07-28 21:24:11',NULL);
-- @@
INSERT INTO `qa_questions` (`id`,`slug`,`title`,`body_md`,`author_id`,`category_id`,`status`,`duplicate_of_id`,`view_count`,`vote_score`,`answer_count`,`accepted_answer_id`,`created_at`,`updated_at`,`last_activity_at`,`deleted_at`) VALUES ('18','use-my-existing-users-table-for-login','Can PPPHP authenticate against my existing users table?','I already have a members table with logins. Can PPPHP use it instead of creating its own users table?','5','6','open',NULL,'0','13','1','20','2026-07-29 21:24:11','2026-08-05 21:24:11','2026-07-29 21:24:11',NULL);
-- @@
INSERT INTO `qa_questions` (`id`,`slug`,`title`,`body_md`,`author_id`,`category_id`,`status`,`duplicate_of_id`,`view_count`,`vote_score`,`answer_count`,`accepted_answer_id`,`created_at`,`updated_at`,`last_activity_at`,`deleted_at`) VALUES ('19','enable-two-factor-authentication-2fa','How do I add two-factor authentication (2FA)?','I need 2FA on my app\'s login. What does PPPHP support and does it need an SMS/email service?','5','6','open',NULL,'0','11','1','21','2026-07-30 21:24:11','2026-08-05 21:24:11','2026-07-30 21:24:11',NULL);
-- @@
INSERT INTO `qa_questions` (`id`,`slug`,`title`,`body_md`,`author_id`,`category_id`,`status`,`duplicate_of_id`,`view_count`,`vote_score`,`answer_count`,`accepted_answer_id`,`created_at`,`updated_at`,`last_activity_at`,`deleted_at`) VALUES ('20','make-each-user-see-only-their-own-records','How do I make each user see only their own records?','In a shared app, each salesperson should only see their own leads. How?','5','6','open',NULL,'0','12','1','22','2026-07-31 21:24:11','2026-08-05 21:24:11','2026-07-31 21:24:11',NULL);
-- @@
INSERT INTO `qa_questions` (`id`,`slug`,`title`,`body_md`,`author_id`,`category_id`,`status`,`duplicate_of_id`,`view_count`,`vote_score`,`answer_count`,`accepted_answer_id`,`created_at`,`updated_at`,`last_activity_at`,`deleted_at`) VALUES ('21','encrypt-sensitive-fields-like-ssn-at-rest','Can I encrypt sensitive fields like SSN at rest?','We store card numbers and IDs. Can PPPHP encrypt specific columns in the database?','5','6','open',NULL,'0','9','1','23','2026-08-01 21:24:11','2026-08-05 21:24:11','2026-08-01 21:24:11',NULL);
-- @@
INSERT INTO `qa_questions` (`id`,`slug`,`title`,`body_md`,`author_id`,`category_id`,`status`,`duplicate_of_id`,`view_count`,`vote_score`,`answer_count`,`accepted_answer_id`,`created_at`,`updated_at`,`last_activity_at`,`deleted_at`) VALUES ('22','deploy-the-generated-app-on-shared-hosting','Can I deploy the generated app on cheap shared hosting?','Do I need a VPS, or can the output run on ordinary cPanel shared hosting?','5','7','open',NULL,'0','10','1','24','2026-08-02 21:24:11','2026-08-05 21:24:11','2026-08-02 21:24:11',NULL);
-- @@
INSERT INTO `qa_questions` (`id`,`slug`,`title`,`body_md`,`author_id`,`category_id`,`status`,`duplicate_of_id`,`view_count`,`vote_score`,`answer_count`,`accepted_answer_id`,`created_at`,`updated_at`,`last_activity_at`,`deleted_at`) VALUES ('23','run-custom-php-when-a-record-is-saved','How do I run custom PHP code when a record is saved?','I need to send an email and stamp a field whenever a record is created. Where does that logic go?','5','3','open',NULL,'0','11','1','25','2026-08-03 21:24:11','2026-08-05 21:24:11','2026-08-03 21:24:11',NULL);
-- @@
INSERT INTO `qa_questions` (`id`,`slug`,`title`,`body_md`,`author_id`,`category_id`,`status`,`duplicate_of_id`,`view_count`,`vote_score`,`answer_count`,`accepted_answer_id`,`created_at`,`updated_at`,`last_activity_at`,`deleted_at`) VALUES ('24','create-a-custom-field-type-or-input-control','Can I create a custom field type or input control?','The built-in inputs are great but I need a special picker. Can I add my own field control?','5','8','open',NULL,'0','8','1','26','2026-08-04 21:24:11','2026-08-05 21:24:11','2026-08-04 21:24:11',NULL);
-- @@
INSERT INTO `qa_answers` (`id`,`question_id`,`author_id`,`body_md`,`vote_score`,`is_accepted`,`created_at`,`updated_at`,`deleted_at`) VALUES ('1','1','5','No. Connecting a database, choosing pages and designing screens is all visual. If you *do* code, you can add PHP and JavaScript in event handlers — but nothing requires it.','6','1','2026-08-05 19:58:52','2026-08-05 19:58:52',NULL);
-- @@
INSERT INTO `qa_answers` (`id`,`question_id`,`author_id`,`body_md`,`vote_score`,`is_accepted`,`created_at`,`updated_at`,`deleted_at`) VALUES ('2','2','5','Use the **Oracle** type in the connection picker (PDO_OCI, default port 1521) and give it your service name. PPPHP generates Oracle-correct SQL — `VARCHAR2`, `NUMBER`, identity keys — automatically.','9','1','2026-08-05 19:58:52','2026-08-05 19:58:52',NULL);
-- @@
INSERT INTO `qa_answers` (`id`,`question_id`,`author_id`,`body_md`,`vote_score`,`is_accepted`,`created_at`,`updated_at`,`deleted_at`) VALUES ('3','3','5','Eight SQL engines: **MySQL, MariaDB, TiDB, PostgreSQL, CockroachDB, SQLite, SQL Server and Oracle.** Each has a dedicated dialect adapter, so the generated SQL is correct for your engine.','7','1','2026-08-05 19:58:52','2026-08-05 19:58:52',NULL);
-- @@
INSERT INTO `qa_answers` (`id`,`question_id`,`author_id`,`body_md`,`vote_score`,`is_accepted`,`created_at`,`updated_at`,`deleted_at`) VALUES ('4','4','5','Anywhere that runs PHP 8, including inexpensive shared hosting. The output is plain PHP you own — nothing to install on the server beyond the files themselves.','5','1','2026-08-05 19:58:52','2026-08-05 19:58:52',NULL);
-- @@
INSERT INTO `qa_answers` (`id`,`question_id`,`author_id`,`body_md`,`vote_score`,`is_accepted`,`created_at`,`updated_at`,`deleted_at`) VALUES ('5','5','5','Yes — per-page custom CSS and JavaScript, lifecycle event hooks in PHP and JS, your own uploaded files, and custom field controls. Full control when you need it.','4','1','2026-08-05 19:58:52','2026-08-05 19:58:52',NULL);
-- @@
INSERT INTO `qa_answers` (`id`,`question_id`,`author_id`,`body_md`,`vote_score`,`is_accepted`,`created_at`,`updated_at`,`deleted_at`) VALUES ('9','7','5','PPPHP is a **low-code** RAD platform. You connect a database, pick tables, and design list / add / edit / view screens visually — no coding needed for a fully working app. When you want more control you can add custom **PHP** and **JavaScript**, lifecycle event hooks, and your own field controls. So it\'s no-code to start, low-code when you need it.','9','1','2026-07-16 21:24:11','2026-08-05 21:24:11',NULL);
-- @@
INSERT INTO `qa_answers` (`id`,`question_id`,`author_id`,`body_md`,`vote_score`,`is_accepted`,`created_at`,`updated_at`,`deleted_at`) VALUES ('10','8','5','In the project\'s **Database Connection**, pick **PostgreSQL** (default port 5432), enter host, database, user and password, then **Test connection**. PPPHP ships a dedicated PostgreSQL dialect, so identity keys, `RETURNING`, casting and quoting are all Postgres-correct. CockroachDB connects the same way.','7','1','2026-07-18 21:24:11','2026-08-05 21:24:11',NULL);
-- @@
INSERT INTO `qa_answers` (`id`,`question_id`,`author_id`,`body_md`,`vote_score`,`is_accepted`,`created_at`,`updated_at`,`deleted_at`) VALUES ('11','9','5','Each **project** connects to one database, but you can create as many projects as you like — one per database — and deploy them together. Owners can also provision **managed databases** and assign them to users. For cross-database reads, use a SQL View or an event hook.','5','1','2026-07-20 21:24:11','2026-08-05 21:24:11',NULL);
-- @@
INSERT INTO `qa_answers` (`id`,`question_id`,`author_id`,`body_md`,`vote_score`,`is_accepted`,`created_at`,`updated_at`,`deleted_at`) VALUES ('12','10','5','Every generated table gets an **Import** page: upload a **CSV or Excel** file, map columns to fields, and rows are validated and inserted. **Export** is built in as well — CSV, Excel, Word, JSON and XML — powered by the DataOps runtime, so the formats are pluggable.','6','1','2026-07-22 21:24:11','2026-08-05 21:24:11',NULL);
-- @@
INSERT INTO `qa_answers` (`id`,`question_id`,`author_id`,`body_md`,`vote_score`,`is_accepted`,`created_at`,`updated_at`,`deleted_at`) VALUES ('13','11','5','You never hand-write forms. In **Pages**, turn on the **Add** and **Edit** experiences for a table and PPPHP generates the forms from your columns with the right input per type. In **Designer** you rearrange fields, group them, add tabs, set labels/placeholders and validation — all visually.','8','1','2026-07-23 21:24:11','2026-08-05 21:24:11',NULL);
-- @@
INSERT INTO `qa_answers` (`id`,`question_id`,`author_id`,`body_md`,`vote_score`,`is_accepted`,`created_at`,`updated_at`,`deleted_at`) VALUES ('14','12','5','Use the **master–detail** (detail-grid) component. On a parent record\'s view/edit page it shows a filtered grid of child rows, with inline add prefilled with the parent key. Define the relationship in **Link Tables**, then drop the detail grid onto the page.','10','1','2026-07-24 21:24:11','2026-08-05 21:24:11',NULL);
-- @@
INSERT INTO `qa_answers` (`id`,`question_id`,`author_id`,`body_md`,`vote_score`,`is_accepted`,`created_at`,`updated_at`,`deleted_at`) VALUES ('15','13','5','Yes. The dashboard supports data-bound **KPI tiles** and **charts** (bar, line, pie) that read live from your tables, plus widgets like recent activity, mini-tables and a calendar. Add them from the Designer palette and bind each to a query — no chart code.','11','1','2026-07-25 21:24:11','2026-08-05 21:24:11',NULL);
-- @@
INSERT INTO `qa_answers` (`id`,`question_id`,`author_id`,`body_md`,`vote_score`,`is_accepted`,`created_at`,`updated_at`,`deleted_at`) VALUES ('16','14','5','From the **Tables** toolbar choose **Create Calendar**, pick the date column (plus optional end / title / colour columns) and PPPHP builds a month / week / day calendar page. Users can drag events to reschedule and click a day to add — all wired to your table.','6','1','2026-07-26 21:24:11','2026-08-05 21:24:11',NULL);
-- @@
INSERT INTO `qa_answers` (`id`,`question_id`,`author_id`,`body_md`,`vote_score`,`is_accepted`,`created_at`,`updated_at`,`deleted_at`) VALUES ('17','15','5','Turn on the **PDF** page type (or the per-record *Save as PDF*) for the table and each record gets a printer-clean PDF to download — generated **server-side** with the bundled dompdf, so there is nothing to install on your host.','5','1','2026-07-27 21:24:11','2026-08-05 21:24:11',NULL);
-- @@
INSERT INTO `qa_answers` (`id`,`question_id`,`author_id`,`body_md`,`vote_score`,`is_accepted`,`created_at`,`updated_at`,`deleted_at`) VALUES ('18','16','5','Themes are data-driven (`--pp-*` design tokens), so you pick or build a theme in **Style** and the whole app re-skins — Bootstrap included. Presets cover light and dark, and you can set a per-page theme override. (This community even has a light/dark switch built the same way.)','7','1','2026-07-28 21:24:11','2026-08-05 21:24:11',NULL);
-- @@
INSERT INTO `qa_answers` (`id`,`question_id`,`author_id`,`body_md`,`vote_score`,`is_accepted`,`created_at`,`updated_at`,`deleted_at`) VALUES ('19','17','5','In **Security → Users & Groups** create groups (Sales, Manager, Admin…) and in **Permissions** set a group × table matrix (view / add / edit / delete / export). Enforcement is **deny-by-default** and runs on both the page and the API; owner/admin roles bypass so you can never lock out your own admins.','12','1','2026-07-29 21:24:11','2026-08-05 21:24:11',NULL);
-- @@
INSERT INTO `qa_answers` (`id`,`question_id`,`author_id`,`body_md`,`vote_score`,`is_accepted`,`created_at`,`updated_at`,`deleted_at`) VALUES ('20','18','5','Yes. In **Security → Database authentication** choose **Use existing table**, pick your table and map Username / Email / Password / Role / Status to your columns. PPPHP bridges it so login, registration, password reset and 2FA all target your table — and it will add any missing column for you.','9','1','2026-07-30 21:24:11','2026-08-05 21:24:11',NULL);
-- @@
INSERT INTO `qa_answers` (`id`,`question_id`,`author_id`,`body_md`,`vote_score`,`is_accepted`,`created_at`,`updated_at`,`deleted_at`) VALUES ('21','19','5','In **Security → Two-Factor Authentication** switch on the methods you want — authenticator app, email or SMS — and map the phone/email column. In the built app each user enables one from their account menu: scan a locally-rendered QR (the secret never leaves the browser) and save backup codes. **TOTP** needs no SMTP; email/SMS do.','8','1','2026-07-31 21:24:11','2026-08-05 21:24:11',NULL);
-- @@
INSERT INTO `qa_answers` (`id`,`question_id`,`author_id`,`body_md`,`vote_score`,`is_accepted`,`created_at`,`updated_at`,`deleted_at`) VALUES ('22','20','5','Use **Row-Level Security**. Set the table\'s rule to **Owner** (compare an owner column to the signed-in user\'s id — each user sees only their rows) or a **Custom** condition like `region = \'APAC\'`. Rules are read live and enforced on list, view, edit, delete, print and export. Admins are never restricted.','9','1','2026-08-01 21:24:11','2026-08-05 21:24:11',NULL);
-- @@
INSERT INTO `qa_answers` (`id`,`question_id`,`author_id`,`body_md`,`vote_score`,`is_accepted`,`created_at`,`updated_at`,`deleted_at`) VALUES ('23','21','5','Yes — **Field Encryption** encrypts chosen fields at rest with **AES-256-GCM**. Values are decrypted transparently on list/view/edit/print/export for authorised users, and the key lives **outside** the database. Ideal for SSNs, card numbers or tokens.','7','1','2026-08-02 21:24:11','2026-08-05 21:24:11',NULL);
-- @@
INSERT INTO `qa_answers` (`id`,`question_id`,`author_id`,`body_md`,`vote_score`,`is_accepted`,`created_at`,`updated_at`,`deleted_at`) VALUES ('24','22','5','Yes. The output is plain **PHP 8** you own — no framework install and no build tools on the server. Upload the files, point `config/database.php` at your database, and it runs on inexpensive shared hosting (cPanel / DirectAdmin). If it lives in a subfolder, set the base URL.','6','1','2026-08-03 21:24:11','2026-08-05 21:24:11',NULL);
-- @@
INSERT INTO `qa_answers` (`id`,`question_id`,`author_id`,`body_md`,`vote_score`,`is_accepted`,`created_at`,`updated_at`,`deleted_at`) VALUES ('25','23','5','Use **Events**. For a table add a server-side hook like `beforeSave`, `afterSave` or `afterDelete` and write PHP with IntelliSense help — there are global and per-table events, plus client-side JS hooks. Your code is compiled into the app on **Build**, so there\'s no runtime overhead.','8','1','2026-08-04 21:24:11','2026-08-05 21:24:11',NULL);
-- @@
INSERT INTO `qa_answers` (`id`,`question_id`,`author_id`,`body_md`,`vote_score`,`is_accepted`,`created_at`,`updated_at`,`deleted_at`) VALUES ('26','24','5','Yes. PPPHP has a plugin system for **field controls** — View, Edit, Filter and Validation plugins. Drop a `Plugin.php` (plus optional JS/CSS) into `plugins/Edit/<Name>/` and it appears as a *View As / Edit As* option for any field. The bundled Nepali date picker is a working example.','6','1','2026-08-05 21:24:11','2026-08-05 21:24:11',NULL);
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('2','1');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('3','2');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('8','2');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('4','3');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('22','3');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('17','4');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('19','4');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('21','4');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('24','5');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('7','6');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('7','7');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('7','8');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('8','9');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('8','10');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('9','11');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('9','12');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('10','13');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('10','14');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('10','15');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('10','16');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('15','16');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('11','17');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('12','17');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('14','17');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('11','18');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('12','19');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('12','20');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('13','21');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('13','22');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('13','23');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('14','24');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('15','25');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('16','26');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('16','27');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('16','28');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('17','29');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('20','29');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('17','30');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('18','31');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('19','31');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('18','32');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('18','33');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('19','34');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('20','35');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('21','36');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('22','37');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('22','38');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('23','38');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('23','39');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('23','40');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('24','41');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('24','42');
-- @@

-- @@
-- ── New Sites/custom-pages how-to Q&A (2026-08-11) ──
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('43','standalone','standalone',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('44','custom-pages','custom-pages',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('45','landing-page','landing-page',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('46','data-binding','data-binding',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('47','components','components',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('48','seo','seo',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('49','favicon','favicon',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('50','error-page','error-page',NULL,'0');
-- @@
INSERT INTO `qa_tags` (`id`,`slug`,`name`,`description`,`usage_count`) VALUES ('51','starter-templates','starter-templates',NULL,'0');
-- @@
INSERT INTO `qa_questions` (`id`,`slug`,`title`,`body_md`,`author_id`,`category_id`,`status`,`duplicate_of_id`,`view_count`,`vote_score`,`answer_count`,`accepted_answer_id`,`created_at`,`updated_at`,`last_activity_at`,`deleted_at`) VALUES ('25','build-standalone-website-no-database','How do I build a standalone website with no database in PPPHP?','I don\'t need CRUD or tables — I want a marketing site / landing page. Can PPPHP build a database-free site?','1','1','open',NULL,'86','7','1',NULL,'2026-08-11 10:20:00','2026-08-11 10:20:00','2026-08-11 10:20:00',NULL);
-- @@
INSERT INTO `qa_answers` (`id`,`question_id`,`author_id`,`body_md`,`vote_score`,`is_accepted`,`created_at`,`updated_at`,`deleted_at`) VALUES ('27','25','5','Yes. Create a **standalone project** (choose *no database* when you create it). Every page is a design surface:

1. In the **Designer**, add a page and drag in section components — Hero, Feature Grid, Pricing, FAQ, Footer and more.
2. Turn on **Page frame** (chromeless) for a true landing page, or apply a starter layout to get a full page in one click.
3. **Build** — you get a self-contained static-style PHP site (no DB connection, no login required) you can upload anywhere.

Standalone builds also emit a dynamic `sitemap.php` and `robots.txt`, and honour per-page SEO. The DB-only console modules (Tables, Query, Events…) stay locked because there\'s nothing for them to do.','9','1','2026-08-11 10:20:00','2026-08-11 10:20:00',NULL);
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('25','43');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('25','6');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('25','17');
-- @@
INSERT INTO `qa_questions` (`id`,`slug`,`title`,`body_md`,`author_id`,`category_id`,`status`,`duplicate_of_id`,`view_count`,`vote_score`,`answer_count`,`accepted_answer_id`,`created_at`,`updated_at`,`last_activity_at`,`deleted_at`) VALUES ('26','marketing-landing-page-inside-database-app','Can I add a marketing or landing page inside my database app?','My app has tables and CRUD screens, but I\'d like a branded landing / welcome page for signed-in users.','5','4','open',NULL,'72','6','1',NULL,'2026-08-11 10:20:00','2026-08-11 10:20:00','2026-08-11 10:20:00',NULL);
-- @@
INSERT INTO `qa_answers` (`id`,`question_id`,`author_id`,`body_md`,`vote_score`,`is_accepted`,`created_at`,`updated_at`,`deleted_at`) VALUES ('28','26','5','Absolutely. Add a **custom page** under any table (Pages panel → *New custom page*). It:

- renders **inside the app shell** (navbar + sidebar + breadcrumb), so it feels part of the app;
- is **auth-gated** like your other pages;
- gets an automatic menu item so users can reach it.

Then drag the same section components (Hero, Stats, Feature Grid…) onto it. Because it\'s a real app page, components can also read **live data** from your tables — see the data-binding question.','8','1','2026-08-11 10:20:00','2026-08-11 10:20:00',NULL);
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('26','44');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('26','45');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('26','17');
-- @@
INSERT INTO `qa_questions` (`id`,`slug`,`title`,`body_md`,`author_id`,`category_id`,`status`,`duplicate_of_id`,`view_count`,`vote_score`,`answer_count`,`accepted_answer_id`,`created_at`,`updated_at`,`last_activity_at`,`deleted_at`) VALUES ('27','stats-post-grid-live-data-from-table','How do I make Stats or a Post Grid show live data from a table?','I dropped a Stats block and a Post Grid on a page. How do I bind them to real records instead of typing numbers?','5','4','open',NULL,'64','5','1',NULL,'2026-08-11 10:20:00','2026-08-11 10:20:00','2026-08-11 10:20:00',NULL);
-- @@
INSERT INTO `qa_answers` (`id`,`question_id`,`author_id`,`body_md`,`vote_score`,`is_accepted`,`created_at`,`updated_at`,`deleted_at`) VALUES ('29','27','5','Select the component and open its **Live data** section in the inspector:

- **Stats** — per metric, pick a *Table* and an *Aggregate* (`count / sum / avg / min / max`) and an optional column. Leave the table blank to keep a manual number. It even feeds the count-up animation.
- **Logo Cloud** — bind an *image column* to show one logo per row.
- **Post Grid** — map *title / excerpt / image / author / date* columns; each card links to that record\'s **view page** (or a URL column).

All of them accept a **WHERE filter** that supports SQL variables like `:userid` and `:today`. Binding is off whenever the table field is empty, so nothing changes until you opt in.','7','1','2026-08-11 10:20:00','2026-08-11 10:20:00',NULL);
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('27','46');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('27','47');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('27','21');
-- @@
INSERT INTO `qa_questions` (`id`,`slug`,`title`,`body_md`,`author_id`,`category_id`,`status`,`duplicate_of_id`,`view_count`,`vote_score`,`answer_count`,`accepted_answer_id`,`created_at`,`updated_at`,`last_activity_at`,`deleted_at`) VALUES ('28','page-seo-meta-social-image-sitemap','How do I set a page\'s SEO — description, social image, sitemap?','I want good link previews and search results for my pages. Where are the SEO settings?','1','4','open',NULL,'58','6','1',NULL,'2026-08-11 10:20:00','2026-08-11 10:20:00','2026-08-11 10:20:00',NULL);
-- @@
INSERT INTO `qa_answers` (`id`,`question_id`,`author_id`,`body_md`,`vote_score`,`is_accepted`,`created_at`,`updated_at`,`deleted_at`) VALUES ('30','28','5','Open the page\'s **Properties → SEO & sharing**:

- **Meta description**, **Social image** (Open Graph / Twitter), **Canonical URL**, **Content type** (Web page / Article), author and published date, and a **noindex** toggle.

On build, PPPHP writes the `<meta>`/Open Graph/Twitter tags, a canonical link, and **automatic JSON-LD** (FAQ blocks become `FAQPage`; an Article page emits Article + BreadcrumbList; your brand emits Organization + WebSite). Standalone sites additionally get a dynamic `sitemap.php` + `robots.txt`. There\'s also an **Advanced → Head code** box for analytics or verification snippets.','7','1','2026-08-11 10:20:00','2026-08-11 10:20:00',NULL);
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('28','48');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('28','45');
-- @@
INSERT INTO `qa_questions` (`id`,`slug`,`title`,`body_md`,`author_id`,`category_id`,`status`,`duplicate_of_id`,`view_count`,`vote_score`,`answer_count`,`accepted_answer_id`,`created_at`,`updated_at`,`last_activity_at`,`deleted_at`) VALUES ('29','custom-favicon-from-uploaded-file','Can the favicon come from an uploaded file instead of a URL?','I have a favicon image I uploaded to the project. Do I have to host it elsewhere and paste a URL?','5','5','open',NULL,'49','5','1',NULL,'2026-08-11 10:20:00','2026-08-11 10:20:00','2026-08-11 10:20:00',NULL);
-- @@
INSERT INTO `qa_answers` (`id`,`question_id`,`author_id`,`body_md`,`vote_score`,`is_accepted`,`created_at`,`updated_at`,`deleted_at`) VALUES ('31','29','5','No — the **Favicon** field (Properties → SEO & sharing) accepts either:

- a full **URL** (or a `data:` URI), or
- the path to a file you uploaded under **Custom Files**, e.g. `/custom/favicon.png`.

A relative path is resolved against the app root on build (`APP_BASE`), so it works even when the app is installed in a subfolder. Leave it blank and the browser tab falls back to your **Style** logo automatically. Use a square PNG, SVG or ICO.','6','1','2026-08-11 10:20:00','2026-08-11 10:20:00',NULL);
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('29','49');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('29','28');
-- @@
INSERT INTO `qa_questions` (`id`,`slug`,`title`,`body_md`,`author_id`,`category_id`,`status`,`duplicate_of_id`,`view_count`,`vote_score`,`answer_count`,`accepted_answer_id`,`created_at`,`updated_at`,`last_activity_at`,`deleted_at`) VALUES ('30','custom-404-page-standalone-site','How do I add a custom 404 page to my standalone site?','When someone hits a URL that doesn\'t exist on my standalone site, what shows? Can I brand it?','1','4','open',NULL,'41','4','1',NULL,'2026-08-11 10:20:00','2026-08-11 10:20:00','2026-08-11 10:20:00',NULL);
-- @@
INSERT INTO `qa_answers` (`id`,`question_id`,`author_id`,`body_md`,`vote_score`,`is_accepted`,`created_at`,`updated_at`,`deleted_at`) VALUES ('32','30','5','Standalone builds already ship a **branded `404.php`** automatically — it uses your theme and brand, shows a large *404* and a *Back to home* button, and is marked `noindex`. The generated router serves it for any unknown URL and returns a proper **HTTP 404** status.

If you want a fully custom design, create a custom page and the branded default still covers everything else. Nothing to wire up — it\'s part of every standalone build.','6','1','2026-08-11 10:20:00','2026-08-11 10:20:00',NULL);
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('30','50');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('30','43');
-- @@
INSERT INTO `qa_questions` (`id`,`slug`,`title`,`body_md`,`author_id`,`category_id`,`status`,`duplicate_of_id`,`view_count`,`vote_score`,`answer_count`,`accepted_answer_id`,`created_at`,`updated_at`,`last_activity_at`,`deleted_at`) VALUES ('31','apply-starter-layout-saas-agency','How do I apply a starter layout like SaaS or Agency to a page?','Is there a faster way than dragging every section? I saw templates mentioned.','5','4','open',NULL,'55','6','1',NULL,'2026-08-11 10:20:00','2026-08-11 10:20:00','2026-08-11 10:20:00',NULL);
-- @@
INSERT INTO `qa_answers` (`id`,`question_id`,`author_id`,`body_md`,`vote_score`,`is_accepted`,`created_at`,`updated_at`,`deleted_at`) VALUES ('33','31','5','Yes — in the **Pages** panel choose **Apply a layout**, search the 17 starters (SaaS, Agency, Portfolio, Event, Restaurant, Wedding, Link-in-bio…), and pick one. You\'ll be offered **Replace** or **Append**.

- On a **standalone** page you get the full chromeless frame (its own navbar + footer).
- On a **database-app** custom page it keeps the app shell and drops just the **content sections** in — the starter\'s own navbar/footer are removed so you don\'t get a second one.

Everything is then editable like any other component.','8','1','2026-08-11 10:20:00','2026-08-11 10:20:00',NULL);
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('31','51');
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('31','17');
-- @@
INSERT INTO `qa_questions` (`id`,`slug`,`title`,`body_md`,`author_id`,`category_id`,`status`,`duplicate_of_id`,`view_count`,`vote_score`,`answer_count`,`accepted_answer_id`,`created_at`,`updated_at`,`last_activity_at`,`deleted_at`) VALUES ('32','why-tables-events-locked-standalone-project','Why are Tables, Events and some modules locked in my standalone project?','In a standalone project several sidebar items are greyed out with a lock. Is something wrong?','1','9','open',NULL,'47','7','1',NULL,'2026-08-11 10:20:00','2026-08-11 10:20:00','2026-08-11 10:20:00',NULL);
-- @@
INSERT INTO `qa_answers` (`id`,`question_id`,`author_id`,`body_md`,`vote_score`,`is_accepted`,`created_at`,`updated_at`,`deleted_at`) VALUES ('34','32','5','Nothing\'s wrong — a **standalone project has no database**, so the modules that only make sense with one are intentionally locked: **Tables, Query, Pages, Fields, Security, Events and Notifications** (Events and Notifications are record-change hooks, so they need tables too).

Everything a site needs stays open: **Designer, Style, Custom Files, Output, Finished and Deploy**. Build your pages in the Designer; if you later need data, create a database project instead.','9','1','2026-08-11 10:20:00','2026-08-11 10:20:00',NULL);
-- @@
INSERT INTO `qa_question_tags` (`question_id`,`tag_id`) VALUES ('32','43');
-- @@
UPDATE `qa_questions` SET `accepted_answer_id`='27' WHERE `id`='25';
-- @@
UPDATE `qa_questions` SET `accepted_answer_id`='28' WHERE `id`='26';
-- @@
UPDATE `qa_questions` SET `accepted_answer_id`='29' WHERE `id`='27';
-- @@
UPDATE `qa_questions` SET `accepted_answer_id`='30' WHERE `id`='28';
-- @@
UPDATE `qa_questions` SET `accepted_answer_id`='31' WHERE `id`='29';
-- @@
UPDATE `qa_questions` SET `accepted_answer_id`='32' WHERE `id`='30';
-- @@
UPDATE `qa_questions` SET `accepted_answer_id`='33' WHERE `id`='31';
-- @@
UPDATE `qa_questions` SET `accepted_answer_id`='34' WHERE `id`='32';
-- @@
UPDATE `qa_categories` c SET `question_count` = (SELECT COUNT(*) FROM `qa_questions` q WHERE q.category_id=c.id AND q.deleted_at IS NULL);
-- @@
UPDATE `qa_tags` t SET `usage_count` = (SELECT COUNT(*) FROM `qa_question_tags` qt WHERE qt.tag_id=t.id);
-- @@
