PDOModel - Database abstraction and helper PHP class icon

PDOModel - Database abstraction and helper PHP class

PDOModel - Database abstraction and helper PHP class

Description

More Details

Documentation

documentation/pdo/

PDOModel – Database abstraction and helper PHP class that helps to do insert, update, delete, select operation using PDO without writing any queries and with much lesser code. It supports Mysql, Postgres,SQlite and SQL Server database.

Version 1.3 – PDOModel now supports SQL Server along with PGSQL, SQLite and Mysql.

PDOModel provides a complete solution to perform CRUD operations on three different types of database (Mysql, Postgres and Sqlite). It provides various helper functions to export data directly to csv,excel,xml,pdf,html and many more useful functions.

Example of how to write SQL select query using PDOModel

$pdomodel = new PDOModel(); //create object of the PDOModel class $pdomodel->connect("localhost", "root", "", "pdocrud");//connect to database $result = $pdomodel->select("emp"); //select * from `emp`

That’s it, you need to write just 2-3 line of code. You can write very complex queries using PDOModel functions

PDOModel supports three type of database, Mysql, Postgres and Sqlite.

PDOModel script allows you to export data directly in various database formats.

Examples

$pdomodel = new PDOModel();//create object $pdomodel->connect("localhost", "root", "", "pdocrud");//connect to database - three different database type available /* INSERT , UPDATE AND DELETE OPERATION */ $pdomodel->insert("emp", array("firstName" => "John", "lastName" => "Jonathan", "gender" => "male")); $pdomodel->where("orderId", 7); $pdomodel->update("order", array("orderNumber"=>"44", "customerName"=>"BKG", "address"=>"140 shakti nagar")); $pdomodel->where("orderId", 7); $pdomodel->delete("order"); /* SELECT */ $result = $pdomodel->select("emp"); /* WHERE, AND, OR, BETWEEN, GROUP BY, ORDER BY, LIKE , HAVING */ $pdomodel->where("orderNumber", "5", "!="); $pdomodel->openBrackets ="("; $pdomodel->where("city", "Indore", "="); $pdomodel->andOrOperator="OR"; $pdomodel->closedBrackets =")"; $pdomodel->groupByCols = array("orderId"); $pdomodel->orderByCols = array("orderId desc", "state asc"); $pdomodel->havingCondtion = array("sum(orderId)>2"); $pdomodel->limit = "0,5"; $pdomodel->where("empId", array(36,37), "BETWEEN"); $pdomodel->where("firstName", '%P%', "LIKE"); $pdomodel->where("empId", array(36,37,39,40), "IN"); /* subquery/inner query */ $pdomodel->subQuery("select empId from emp where empId=?","empId",array(34)); /* where subquery */ $pdomodel->where_subquery("orderId", "select orderId from `order` where orderId=?", "IN",array(10)); /*rename, trucate, drop table, column name, primary key, tablefield info*/ $pdomodel->truncateTable("wp_postmeta"); $pdomodel->renameTable("states","state"); $pdomodel->dropTable("empleave"); $records = $pdomodel->columnNames("order"); $records = $pdomodel->primaryKey("order"); $records = $pdomodel->tableFieldInfo("order"); /*execute sql*/ $result = $pdomodel->executeQuery("select * from emp where empId = ?", array(39));

Main Features:

  1. Perform Insert, update, delete and select operations using simple functions
  2. Three different types of database support (Mysql, PGSql and SQLite)
  3. Complex queries support with use of multiple “and” and “or”
  4. Multiple table join Operation using simple functions
  5. Table related operations like get all tables from database, truncate table, delete table, rename table etc.
  6. Subquery/inner query can be embedded
  7. Column based operation like getting all columns of table, primary key of table etc
  8. Export functions to export data in CSV, PDF, Excel, HTML, XML Format
  9. Helper functions like pagination, random password generation
  10. Best practices using PDO with use of prepared statements
  11. Support for PDO Transactions
  12. Support for batch operations for insert, update and delete
  13. Execute query directly with parameter binding
  14. Various debugging options like get last query, get rows inserted, error messages etc
  15. Support for order by, group by, like, between, in, not in, having etc
  16. Well documented and demo codes to make things easier to understand
  17. Supports method chaining
  18. Batch operations for faster result

Version 1.4

Added-

  • Now support Insert On Duplicate Update statement also.
  • Resolved bug for sqlite

Version 1.3

Added-

  • Now support sql server database also. Please note that you must have SQLServer extension installed for this. For more details, check here
  • Resolved bug for sqlite

Version 1.2

Added-

  • Json export option
  • CSV Import option
  • Excel Import option
  • XML Import option
  • Various functions to support chaining
  • Resolved bug for truncate function for sqlite
  • improved documentation
Min requirement for the script PHP Version 5.3 and above Must have write access for download folder

Credits:

Tcpdf phpExcel

Our other popular script

External listing. code.market does not sell this product and does not process payment for it. Pricing, payment, delivery, licensing, refunds, and support are handled by the third-party merchant on its own website. We may earn an affiliate commission from a referral. Details.

Products of the Week.

Submit
codester.com

codester.com

SocialDesk+: Omnichannel Social Commerce & Business Management Platform This is stronger than simply “Social Commerce and Messaging” because it tells buyers this is a complete business platform, not just a messaging script. Turn Social Conversations Into Sales SocialDesk+ is a complete omnichannel social commerce and business management platform built for businesses that sell and communicate with customers through social media. Instead of switching between WhatsApp, Facebook, Instagram and TikTok, businesses can manage customer conversations, comments, products, leads, follow-ups, automation, teams and business reports from one professional workspace. And because the full source code is included, developers, agencies and entrepreneurs can customize, rebrand and launch SocialDesk+ as their own business solution or SaaS platform. 🚀 Build Your Own Social Commerce Business SocialDesk+ gives you the foundation to launch: - Your own SaaS platform - A white-label social CRM - A social-commerce management system - A customer communication platform - A business messaging solution - A custom solution for clients - A multi-business subscription platform 💬 Connect Your Customers Supported social channels include: WhatsApp • Facebook • Instagram • TikTok Bring supported conversations into one centralized workspace and help businesses respond faster without constantly switching between platforms. 🛍️ More Than a Messaging Platform SocialDesk+ combines communication with the tools businesses need to manage customer opportunities: Inbox Manage customer conversations from connected channels. Comments Monitor and respond to social-media comments. Customers & Leads Organize customer information and potential buyers. Products & Catalog Manage products and give your team quick access to product information. Follow-Ups Make sure potential customers don't get forgotten. Automation Automate repetitive customer questions and responses. AI Assistant Provide AI-assisted communication when configured. Team Management Give managers and staff access to the business workspace. Reports & Analytics Track activity using business reports and analytics. The current product listing already includes these capabilities. 🔥 Why Buyers Will Want It Launch Faster Start with an already-built business platform instead of developing the entire system from zero. Customize Everything The full source code is included, allowing developers to change branding, features, workflows and integrations. Build a SaaS Create multiple business workspaces and offer SocialDesk+ as a subscription-based service. Sell to Businesses Offer it to retailers, restaurants, service businesses, online sellers, agencies and other businesses that communicate with customers through social media. Mobile + Web + Backend This isn't just a mobile UI template. It includes: - Flutter mobile application - Python / FastAPI backend - Web interface - Administration tools - Database infrastructure - API-based architecture - SQLite / PostgreSQL support - Android and iOS project structure 💼 One Platform. Multiple Business Opportunities. For SaaS Entrepreneurs Launch your own subscription platform and allow multiple businesses to operate inside separate workspaces. For Software Agencies Customize and rebrand the platform for clients instead of building an omnichannel business system from scratch. For Developers Use the complete source code as a foundation for your own social-commerce or customer-management product. For Businesses Deploy a dedicated version for your own customer-service and social-commerce operations. 🧩 What's Included Mobile - Flutter / Dart - Android - iOS project Backend - Python - FastAPI - SQLAlchemy - Alembic Database - SQLite - PostgreSQL Web - HTML5 - CSS3 - JavaScript Deployment - Docker - Docker Compose - Production configuration Business Platform - Multi-workspace architecture - Authentication - Teams - Customers - Products - Messaging - Comments - Automation - Reports - Subscriptions - Administration The current listing also documents third-party integrations such as Meta, TikTok, Stripe, Firebase, SMTP and optional OpenAI configuration. ⚡ What Makes SocialDesk+ Different? You're not buying a simple: ❌ Chat UI ❌ WhatsApp clone ❌ Flutter template ❌ Admin dashboard ❌ Basic CRM You're getting a complete business platform foundation that can be customized, branded and commercialized. Connect. Automate. Manage. Grow. SocialDesk+ Omnichannel Social Commerce & Business Management Platform One important change I'd make to the current listing The current page starts with: “A simple guide to managing your social conversations, customers, products and business activity.”

Other · 5,006 views · 32 clicks

$2

PDOModel - Database abstraction and helper PHP class | Code Market