Database Functions
Database API
Section titled “Database API”Complete reference for database access functions.
Connection Functions
Section titled “Connection Functions”get_db_connection()
Section titled “get_db_connection()”Returns PostgreSQL connection resource.
$connection = get_db_connection();Product Functions
Section titled “Product Functions”get_products_paginated($page, $per_page, $filters)
Section titled “get_products_paginated($page, $per_page, $filters)”Retrieve paginated product list.
get_product_by_id($product_id)
Section titled “get_product_by_id($product_id)”Get single product details.
search_products($query, $filters)
Section titled “search_products($query, $filters)”Search products in database.
Category Functions
Section titled “Category Functions”get_category_tree($parent_id)
Section titled “get_category_tree($parent_id)”Retrieve hierarchical category tree.
get_category_by_id($category_id)
Section titled “get_category_by_id($category_id)”Get single category details.
History Functions
Section titled “History Functions”get_product_price_history($product_id, $days)
Section titled “get_product_price_history($product_id, $days)”Retrieve price history for a product.
Next Steps
Section titled “Next Steps”- Database System - Database architecture
- Database Schema - Schema reference