A downloadable tool for Windows, macOS, and Linux

Download NowName your own price

Introduction

In this project, we aim to develop a simple yet functional database system using only Python and PHP, without relying on external libraries or complex software. The database system is designed to store data in custom .bd files, which are proprietary to this application. These files can be created, read, and manipulated by our Python scripts, and the PHP frontend allows users to interact with the system through a simple web interface.

This project is an exercise in understanding how databases work at a fundamental level. It teaches how to manage data storage, retrieval, and manipulation using basic programming constructs. The primary goal is to create a lightweight, file-based database system that can handle simple operations such as storing user credentials, performing login verifications, and allowing data management through a custom file format.

Project Structure

The project is divided into several components:

  1. Database Management in Python: A Python script handles the core operations of the database, such as creating new records, reading existing records, and searching for specific entries.
  2. Custom .bd File Format: The database is stored in a simple text file with a .bd extension. Each record is stored on a new line, with fields separated by a delimiter (e.g., |).
  3. PHP Frontend: A basic PHP script provides a web interface for user interactions. This interface allows users to input their credentials, which are then verified against the database by the Python script.
  4. Integration between PHP and Python: The PHP script interacts with the Python database manager by passing data through temporary files, allowing seamless integration between the web interface and the backend logic.

Database Management in Python

The Python script (db_manager.py) is the core of the database system. It handles all interactions with the .bd file, including:

  • Initialization: When the script is executed, it checks if the .bd file exists. If not, it creates an empty file. This ensures that the database is always ready for use.
  • Insertion: New records can be added to the database. Each record is a list of fields (e.g., username and password), which are joined by a delimiter and appended to the file.
  • Reading: The script can read all records from the database and return them as a list of lists. Each inner list represents a record, split by the delimiter.
  • Searching: A search function allows the script to find a specific record based on a key (e.g., a username). If a match is found, the corresponding record is returned.

Download

Download NowName your own price

Click download now to get access to the following files:

Data Base - Python.zip 2.2 kB