# 💰 PHP Cloud Mining Simulation Project

A simple cloud mining simulation web app written in PHP with:

- User Registration & Login System 🔐  
- Mining Simulation (Random Earnings) ⛏️  
- Referral Bonus System 👥  
- Withdrawal Request System 💸  
- Mining History Tracking 📊  
- Admin Approval Panel 🧑‍💻  

---

## 💾 Setup Guide

### Step 1: Database Configuration

1. Create a new MySQL database:

```sql
CREATE DATABASE cloud_mining;
Import the provided SQL tables:

sql
Copy
Edit
CREATE TABLE users (
    id INT AUTO_INCREMENT PRIMARY KEY,
    username VARCHAR(50) UNIQUE,
    password VARCHAR(255),
    balance FLOAT DEFAULT 0,
    referral_code VARCHAR(10) UNIQUE,
    referred_by VARCHAR(10) DEFAULT NULL
);

CREATE TABLE mining_history (
    id INT AUTO_INCREMENT PRIMARY KEY,
    user_id INT,
    amount FLOAT,
    mined_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE withdrawals (
    id INT AUTO_INCREMENT PRIMARY KEY,
    user_id INT,
    amount FLOAT,
    status ENUM('Pending', 'Approved', 'Rejected') DEFAULT 'Pending',
    requested_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);



Step 2: PHP Configuration
Open db.php and update your database credentials:

php
Copy
Edit
$host = "localhost";
$user = "root";
$pass = "";
$db = "cloud_mining";