Skip to main content

Posts

Showing posts with the label php and mysql

Basic PHP AJAX MYSQL Exam Application System.

  An exam application is a software or web-based platform designed to facilitate the process of creating, managing, and conducting exams. These applications are commonly used by educational institutions, certification bodies, and businesses for assessments, quizzes, and tests. Functions of an Exam Application Exam Creation & Management Allows educators or administrators to design exams with various question formats (MCQs, essays, fill-in-the-blanks, etc.). Supports question banks for easy reuse and randomization. Candidate Registration & Authentication Manages student or candidate enrollment. Provides secure logins with authentication measures to prevent cheating. Scheduling & Notifications Enables scheduling of exams with specific time slots. Sends automated notifications and reminders to candidates. Online Exam Execution Supports different types of exams (objective, subjective, practical). Offers time management features like countdown tim...

PHP CRUD with custom Alert.

 Database structure: database:testing CREATE TABLE users (     id INT AUTO_INCREMENT PRIMARY KEY,     name VARCHAR(50) NOT NULL,     email VARCHAR(50) NOT NULL ); <?php // Database connection $host = 'localhost'; $dbname = 'testing'; $username = 'root'; $password = ''; try {     $conn = new PDO("mysql:host=$host;dbname=$dbname", $username, $password);     $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch (PDOException $e) {     die("Database connection failed: " . $e->getMessage()); } // Initialize variables $name = $email = ''; $message = ''; $action = 'add'; // Default action $id = ''; // For update operation // Create (Insert) or Update if (isset($_POST['submit'])) {     $name = $_POST['name'];     $email = $_POST['email'];     if (!empty($name) && !empty($email)) {         if ($_POST['action'] === 'add') {       ...

100% Solution of XAMPP Server error mysql shutdown unexpectedly.

  100% Solution of XAMPP Server error mysql shutdown unexpectedly. step 1. go to xampp/mysql folder where we find a folder named data where we will have to do some changes.  first copy  the entire data folder and save it in a different name like prev-data that is why you may face data loss due to wrong operation. After go to the data folder and open it and delete the following folders and files. mysql performance schema aria_log.00000001 aria_log_control ib_buffer-pool ib_logfile0 ib_logfile1 ibdata1 ibtmp1 multi-mastar.info my mysql.pid mysql_error mysqld.dmp and delete all mysql-relay-bin files..... step 2 .After deleting all required files and folder go to xampp/mysql and open backup folder and copy the following files and folder and paste into the data folder.  mysql performance schema aria_log.00000001 aria_log_control ib_buffer-pool ib_logfile0 ib_logfile1 ibdata1 ibtmp1 multi-mastar.info my step 3 . After pasting the files and folder start the xampp server. no...

How to create a simple Shopping App with PHP AJAX MYSQL?

  Below is the complete code for the PHP, MySQL, and AJAX-based shopping cart application with features like adding products to the cart, updating cart quantities, and checkout with Cash on Delivery (COD). This includes all the necessary files and steps to set up the application. --- 1. Database Setup Run the following SQL queries to create the database and tables: ```sql CREATE DATABASE shopping_cart; USE shopping_cart; -- Products table CREATE TABLE products (     id INT AUTO_INCREMENT PRIMARY KEY,     name VARCHAR(255) NOT NULL,     price DECIMAL(10, 2) NOT NULL,     description TEXT,     image VARCHAR(255) ); -- Orders table CREATE TABLE orders (     id INT AUTO_INCREMENT PRIMARY KEY,     customer_name VARCHAR(255) NOT NULL,     customer_email VARCHAR(255) NOT NULL,     customer_address TEXT NOT NULL,     total_amount DECIMAL(10, 2) NOT NULL,     status ENUM('pending', ...

What is INNER JOIN in MySQL and how to use with PHP?

  Database structure of practical Example: -- phpMyAdmin SQL Dump -- version 5.2.1 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Jan 28, 2025 at 01:20 PM -- Server version: 10.4.32-MariaDB -- PHP Version: 8.2.12 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `mytest` -- -- -------------------------------------------------------- -- -- Table structure for table `categories` -- CREATE TABLE `categories` (   `category_id` int(11) NOT NULL,   `category_name` varchar(100) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -- Dumping data for table `categories` -- INSERT INTO `categories` (`category_id`, `category_name`) VALUES (1, '...