Skip to main content

Posts

Showing posts from January, 2025

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, '...

100% Solution of CodeIgniter Message: Creation of dynamic property CI_URI::$config is deprecated.

  100% Solution of CodeIgniter Message: Creation of dynamic property CI_URI::$config is deprecated. This is the most common error occurs when we install xampp 8.2 version in our computer system and try to run Codeigniter 3. To solve the CodeIgniter script running issue, we will have to make some changes in the following files. /system/core/URI.php #[\AllowDynamicProperties] class CI_URI { /system/core/Router.php #[\AllowDynamicProperties] class CI_Router { /system/core/Loader.php #[\AllowDynamicProperties] class CI_Loader { /system/core/Controller.php #[\AllowDynamicProperties] class CI_Controller {    /system/database/DB_driver.php #[\AllowDynamicProperties] abstract class CI_DB_drive Practical Example:

Microsoft Excel top functions.

  Microsoft Excel offers numerous functions to simplify data analysis and calculation. Here are some of the most commonly used and powerful functions: Basic Functions SUM : Adds values. =SUM(A1:A10) AVERAGE : Calculates the mean of numbers. =AVERAGE(A1:A10) IF : Performs logical tests and returns values based on conditions. =IF(A1>10, "Yes", "No") COUNT : Counts numeric values in a range. =COUNT(A1:A10) LEN : Returns the length of a text string. =LEN(A1) Lookup and Reference Functions VLOOKUP : Looks for a value in the first column and returns a value in the same row from another column. =VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup]) HLOOKUP : Similar to Here are practical examples of common Excel functions and how they can be applied in real-life scenarios: 1. SUM Scenario: Calculate the total sales for a week. Example: A B Day Sales Monday 200 Tuesday 150 Wednesday 300 Thursday 250 Friday 100 ...

What is htaccess file and how to create an htaccess file for a PHP Website?

 The .htaccess file (short for "hypertext access") is a configuration file used by web servers running the Apache HTTP Server. It allows website administrators to control and configure various server settings without needing to modify the main server configuration file. This file is placed in a directory on the web server, and its settings can affect that directory and its subdirectories. Here are some common uses of .htaccess : Redirects : You can set up 301 or 302 redirects to move traffic from one URL to another. URL Rewriting : Through mod_rewrite, you can rewrite URLs, creating cleaner, more user-friendly, and SEO-friendly URLs. Access Control : You can restrict access to certain files or directories, such as password protection or blocking specific IP addresses. Custom Error Pages : You can define custom error pages for various HTTP status codes, like 404 (not found) or 500 (server error). Enabling or Disabling Features : You can enable or disable certa...

The Top Google Chrome tips and tricks.

  Here are some top Google Chrome tips and tricks to enhance your browsing experience: Keyboard Shortcuts : Ctrl + T (Windows/Linux) or Cmd + T (Mac): Open a new tab. Ctrl + W (Windows/Linux) or Cmd + W (Mac): Close the current tab. Ctrl + Shift + T (Windows/Linux) or Cmd + Shift + T (Mac): Reopen the last closed tab. Ctrl + Tab (Windows/Linux) or Cmd + Option + Right Arrow (Mac): Switch to the next tab. Use Chrome’s Omnibox : Type the search term directly in the address bar (Omnibox) instead of going to the search engine first. Type chrome:// to access hidden settings and tools. Pin Tabs : Right-click on a tab and select Pin to keep important sites readily available with just a single click. Use Chrome Task Manager : Press Shift + Esc to open Chrome’s built-in Task Manager, which shows how much memory and CPU each tab and extension is using. Chrome Extensions : Install extensions from the Chrome Web Store to add new features like ad bloc...

PHP Ajax Mysql CRUD App with upload, select, radio and checkbox fields.

 Code:index.php <!DOCTYPE html> <html lang="en"> <head>     <meta charset="UTF-8">     <meta name="viewport" content="width=device-width, initial-scale=1.0">     <title>CRUD PHP MySQL AJAX</title>     <link rel="stylesheet" href=" https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css "> </head> <body>     <div class="container mt-5">         <h2>CRUD with Image Upload, Select, Radio, Checkbox</h2>         <!-- Form to Create/Update User -->         <form id="userForm" enctype="multipart/form-data">             <input type="hidden" name="id" id="id">             <div clas...