ICTtask works best with JavaScript enabled.

 

PHP AJAX CRUD using PDO - Edit or Update

Live Demo
post thumbnail
Source Code
hi there, This tutorial is part three of php Ajax Crud System make by using PDO Extention. PDO (PHP Data Object) you can use in your project for secure database extention and easy to handle a big project. It is Object Oriented form of php code procedure style. If you use this so create a object of PDO class then you use this. So in this tutorial we discussing on update data into mysql database by using php procedural form programming style ajax response without page refresh. we have seen not only how can you update data into mysql Database even you can learn how to update uploaded image into folder path without page refresh with jquery validation form. Need to do this a form so already create a form for insert data with validation now we use this.Just we change hidden field action value change by using jquery attr method.If we change this value so our condition change to update condition.Then wiil get value of hidden action field and same code for update. We used to our previous tutorial part of one already checking empty field and valid image format validation.So now when submit form then we will send request to action.php file by using ajax response.php . action file will get value by using $_POST[] Supper global variable. So When we send data to action file we have action method POST so we get value by $_POST[] Supper global variable. Then action file will update data into db_users_account database into table tbl_users. I have also provide sql file with source code see in this tutorial. When will successfully update row data then we show success alert, We not use browser default alert, We have use sweet alert must be load sweet js file. If you can use so First include css and js files by using ofline Download or CDN links for these files. Now do this and Fellow our video tutorial We have also provide youtube Video in this post. In next video tutorial we will make discussing on how to fetch delete row from Mysql table and image from folder by using AJAX response. So please share my post and go to my youtube channel and subscribe and share videos with your friends. Thanks Next Tutorilas Link these:
    Files structure Fellow:
  • Application root folder
    • upload
    • //This Folder into update and upload files
    • action.php
    • //This file will update, fetch all rows data and handle for Insert data into Database Table
    • index.php
    • //This file for view table data and Create form with update

Sourse Code:

  • action.php

  • 
    
  • index.php

  • 
    
  • Database file sql

  • 
    --
    -- Database: `db_users_account`
    --
    
    -- --------------------------------------------------------
    
    --
    -- Table structure for table `tbl_users`
    --
    
    CREATE TABLE `tbl_users` (
      `u_id` int(11) NOT NULL,
      `u_name` varchar(255) NOT NULL,
      `u_email` varchar(255) NOT NULL,
      `u_sex` varchar(11) NOT NULL,
      `u_image` varchar(255) NOT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    
    --
    -- Dumping data for table `tbl_users`
    --
    
    INSERT INTO `tbl_users` (`u_id`, `u_name`, `u_email`, `u_sex`, `u_image`) VALUES
    (27, 'Ruhi', 'women@gmail.com', '2', '10695.jpg'),
    (28, 'Roman', 'Roman@gmail.com', '1', '7156.jpg'),
    (29, 'aslamhasib', 'aslamhasib@gmail.com', '1', '28445.png'),
    (30, 'ibrahim', 'ibrahim@gmail.com', '1', '21906.png'),
    (33, 'Programmer Rayhan', 'icttask.com.rayhan@gmail.com ', '1', '23019.jpg'),
    (34, 'Rakib', 'Rakib@gmail.com', '1', '2610.jpg'),
    (35, 'Rayhan', 'programmer@gmail.com', '1', '29472.jpg');
    
    --
    -- Indexes for dumped tables
    --
    
    --
    -- Indexes for table `tbl_users`
    --
    ALTER TABLE `tbl_users`
      ADD PRIMARY KEY (`u_id`);
    
    --
    -- AUTO_INCREMENT for dumped tables
    --
    
    --
    -- AUTO_INCREMENT for table `tbl_users`
    --
    ALTER TABLE `tbl_users`
      MODIFY `u_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=36;
    /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
    /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
    /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
    
    

    Browse by Category

    php Ajax jQuery Codeigniter html css javascript

    Hi there! I am Rayhan Mondol, a PHP & JAVA Developer and ICT task is my programming blog. I'm fond of developing modern web applications. Contact me, I accept the paid task

    Latest Article

    post thumbnail

    Ajax Shopping Cart Customer Order View & account Update by using PHP OOP PDO(E-Commerce website-part 10)

    post thumbnail

    customer accout logout by using PHP OOP, PDO,COOKIE,AJAX(E-Commerce website-part 9)

    post thumbnail

    Customer Account Login by using PHP OOP PDO,AJAX (E-Commerce website-part 8)

    post thumbnail

    Customer Account Create by using PHP OOP PDO (E-Commerce website-part 7)

    post thumbnail

    Remove product from cart by using PHP OOP PDO(E-Commerce website-part 6)

    post thumbnail

    Ajax Shopping Cart update or Edit by using PHP OOP PDO (E-Commerce website-part 5)

    post thumbnail

    Ajax Shopping Cart View and calculate by using PHP OOP PDO (E-Commerce website-part 4)

    post thumbnail

    Drag and Drop Product Add to Cart by using PHP OOP PDO Ajax Jquery - E-Commerce project- (part-3)

    post thumbnail

    Product Add to Cart using PHP OOP PDO Ajax JQuery - E-Commerce project- (part-2)

    post thumbnail

    Create Dynamic Tabs using PHP OOP PDO - E-Commerce project- (part-1)

    post thumbnail

    CodeIgniter AJAX CRUD using Bootstrap Modal - Delete

    post thumbnail

    CodeIgniter AJAX CRUD using Bootstrap Modal Edit or Update

    post thumbnail

    CodeIgniter AJAX CRUD using Bootstrap Modal Read or view

    post thumbnail

    CodeIgniter AJAX CRUD using Bootstrap Modal-Create

    post thumbnail

    CodeIgniter AJAX CRUD(setup removing index.php from url)