PHPackages                             hashaam-zahid/crud-pdo-operation - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Admin Panels](/categories/admin)
4. /
5. hashaam-zahid/crud-pdo-operation

ActiveLibrary[Admin Panels](/categories/admin)

hashaam-zahid/crud-pdo-operation
================================

PDO CRUD Operations

20PHP

Since Nov 28Pushed 2y ago1 watchersCompare

[ Source](https://github.com/hashaam-zahid/crud-pdo-operation)[ Packagist](https://packagist.org/packages/hashaam-zahid/crud-pdo-operation)[ RSS](/packages/hashaam-zahid-crud-pdo-operation/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

CRUD OOP with PDO Package
=========================

[](#crud-oop-with-pdo-package)

This project implements a CRUD (Create, Read, Update, Delete) operations package using Object-Oriented Programming (OOP) with PDO in PHP. It includes classes for database configuration, database connection, and operations on a "country" entity example.

Contrubition
------------

[](#contrubition)

\[Hashaam Zahid\] ()

Install Setup
-------------

[](#install-setup)

composer require hashaam-zahid/crud-pdo-operation

### How to Load object

[](#how-to-load-object)

```
require_once("classes/country.php");
$objCountry = new country();

//Get All Countries

$resultGetAllCountry = $objCountry->GetAllCountry();

// Check if countries exist

if ($resultGetAllCountry->num_rows > 0):

    while ($rowGetAllCountry = $resultGetAllCountry->fetch_array(MYSQLI_BOTH))
   {
         echo $rowGetAllCountry->name;
   }

else:
    echo ('Something went wrong while fetching country, Try Later');

endif;

```

Folder Structure
----------------

[](#folder-structure)

`/configuration`
configuration.php
`/dbconnect`
db\_connect.php
`/classes`
country.php

`Main directory`

country\_process.php

Usage
-----

[](#usage)

The primary goal of this project is to offer a maintainable and easily understandable solution for performing CRUD operations on a database. It focuses on clean code practices to enhance readability, Reusability and ease of use for developers working with database entities.

### `configuration/configuration.php`

[](#configurationconfigurationphp)

Contains a class with constants defining database connection details.

### `dbconnect/db_connect.php`

[](#dbconnectdb_connectphp)

Implements a class responsible for CRUD operations using PDO. It establishes a database connection and provides methods for insertion, selection, deletion, and updating records.

### `classes/country.php`

[](#classescountryphp)

Defines a class for handling "country" entities. It contains methods to perform operations like fetching all countries, retrieving cities by country ID, inserting, updating, and deleting country records.

### `country_process.php`

[](#country_processphp)

An example usage file where the `country` class methods are instantiated and demonstrated. It showcases how to retrieve countries, cities, insert, update, and delete country records.

Project Structure
-----------------

[](#project-structure)

- `configuration/configuration.php`: Defines database configuration constants.
- `dbconnect/db_connect.php`: Handles database connections and CRUD operations.
- `classes/country.php`: Manages operations related to the "country" entity.
- `country_process.php`: Demonstrates the usage of the `country` class methods.

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. Ensure that you have a LICENSE file in your project root directory, which includes the MIT License details. You can use the following MIT License text:

MIT License

Copyright (c) \[2023\]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Replace \[2023\] with the current year or range of years the project has been developed.

This README.md file structure provides an overview of your project, its directory layout, usage, and licensing information. Adjust it as needed to match your project's specific details and requirements.

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity22

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/bc0c2ae5d64deb4d675818b47e34f3460779d7d0039033e5e8db20b0b4b6d318?d=identicon)[hashaam](/maintainers/hashaam)

---

Top Contributors

[![hashaam-zahid](https://avatars.githubusercontent.com/u/143768406?v=4)](https://github.com/hashaam-zahid "hashaam-zahid (23 commits)")

---

Tags

crudpackagepdophp8

### Embed Badge

![Health badge](/badges/hashaam-zahid-crud-pdo-operation/health.svg)

```
[![Health](https://phpackages.com/badges/hashaam-zahid-crud-pdo-operation/health.svg)](https://phpackages.com/packages/hashaam-zahid-crud-pdo-operation)
```

###  Alternatives

[jeroennoten/laravel-adminlte

Easy AdminLTE integration with Laravel

4.0k4.8M43](/packages/jeroennoten-laravel-adminlte)[dmstr/yii2-adminlte-asset

AdminLTE backend theme asset bundle for Yii 2.0 Framework

1.1k1.8M67](/packages/dmstr-yii2-adminlte-asset)[dwij/laraadmin

LaraAdmin is a Open source Laravel Admin Panel / CMS which can be used as Admin Backend, Data Management Tool or CRM boilerplate for Laravel with features like CRUD Generation, Module Manager, Media, Menus, Backups and much more

1.6k68.7k](/packages/dwij-laraadmin)[filament/spatie-laravel-media-library-plugin

Filament support for `spatie/laravel-medialibrary`.

1764.8M125](/packages/filament-spatie-laravel-media-library-plugin)[bezhansalleh/filament-exceptions

A Simple &amp; Beautiful Pluggable Exception Viewer for FilamentPHP's Admin Panel

193195.9k13](/packages/bezhansalleh-filament-exceptions)[filament/infolists

Easily add beautiful read-only infolists to any Livewire component.

1220.8M36](/packages/filament-infolists)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
