fordev22.com
  • Home
  • สอนทำระบบ POS (Point of Sale)
  • Flutter สำหรับผู้เริ่มต้น
  • PHP+MySqli
  • เนื้อหาอื่น ๆ
    • สอน Bootstrap 5
    • Dreamweaver+Bootstrap+PHP
    • Dreamweaver
    • Computer Tip
  • ABOUT US
    • Personal information
    • บริการ
    • ผลงาน
    • ตัวอย่าง ผลงานด้านการสอน (สอนสดผ่าน Google Meet, Zoom)
  • Search

(2023) PHP+MySqli EP.42 How to AJAX CrudPHP MySqli (Part 2 Update)

April 20, 2023/in PHP+MySqli /by fordev22

(2023) PHP+MySqli EP.42
How to AJAX CrudPHP MySqli
(Part 2 Update)

 

 

 


ระบบบริหารจัดการ ศูนย์ซ่อมรถยนต์ Car Service System ( PHP 7++ ขึ้นไป )

 

ตัวอย่างผลงาน FD22 Logistic 2020 ระบบบริหารจัดการขนส่ง

ระบบ บริหารจัดการร้านกาแฟ PHP | FD22-Cafe (Coffee AND Bakery)

CART&POS (ระบบจัดการงานขายหน้าร้านและ ออนไลน์ สำหรับร้านค้าขนาดกลาง,SME

เว็บไซต์ จองคิวทำเล็บ MANICURE SYSTEM ( PHP 7++ ขึ้นไป )

(2023) PHP+MySqli EP.42 How to AJAX CrudPHP MySqli (Part 2 Update)

ajax_view.php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<a href="#editEmployeeModal" class="edit" data-toggle="modal">
<i class="material-icons update" data-toggle="tooltip"
data-id="<?php echo $row["id"]; ?>"
data-name="<?php echo $row["name"]; ?>"
data-email="<?php echo $row["email"]; ?>"
title="Edit"></i>
</a>
<!-- Edit Modal HTML -->
<div id="editEmployeeModal" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<form id="update_form">
<div class="modal-header">
<h4 class="modal-title">Edit User</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<input type="hidden" id="id_u" name="id" class="form-control" required>
<div class="form-group">
<label>Name</label>
<input type="text" id="name_u" name="name" class="form-control" required>
</div>
<div class="form-group">
<label>Email</label>
<input type="email" id="email_u" name="email" class="form-control" required>
</div>
</div>
<div class="modal-footer">
<input type="hidden" value="2" name="type">
<input type="button" class="btn btn-default" data-dismiss="modal" value="Cancel">
<button type="button" class="btn btn-info" id="update">Update</button>
</div>
</form>
</div>
</div>
</div>

ajax_crud.js

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
$(document).on('click','.update',function(e) {
var id=$(this).attr("data-id");
var name=$(this).attr("data-name");
var email=$(this).attr("data-email");
$('#id_u').val(id);
$('#name_u').val(name);
$('#email_u').val(email);
});
$(document).on('click','#update',function(e) {
var data = $("#update_form").serialize();
$.ajax({
data: data,
type: "post",
url: "save_db.php",
success: function(dataResult){
var dataResult = JSON.parse(dataResult);
if(dataResult.statusCode==200){
$('#editEmployeeModal').modal('hide');
alert('Data updated successfully !');
                        location.reload();
}
else if(dataResult.statusCode==201){
   alert(dataResult);
}
}
});
});

save_db.php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
if(count($_POST)>0){
if($_POST['type']==2){
$id=$_POST['id'];
$name=$_POST['name'];
$email=$_POST['email'];
$sql = "UPDATE `crud` SET `name`='$name',`email`='$email' WHERE id=$id";
if (mysqli_query($conn, $sql)) {
echo json_encode(array("statusCode"=>200));
}
else {
echo "Error: " . $sql . "<br>" . mysqli_error($conn);
}
mysqli_close($conn);
}
}

 

 

Facebook
Twitter
Line
Tags: php, php+sqli php+sqli, Point of Sale Point of SalePOS POS, POS System POS System, ฟรีโปรเจคนักศึกษา, ฟอร์ม php, รับพัฒนาระบบ รับพัฒนาระบบ, รับเขียนโปรแกรม รับเขียนโปรแกรม, สอน bootstrap, สอน php, สอน php mysql, สอน php mysqli, สอน php พื้นฐาน, สอน php เบื้องต้น, สอนทำเว็บ, สอนทำเว็บ สอนทำเว็บ, สอนพัฒนาระบบ สอนพัฒนาระบบ, สอนเขียนเว็บ, สอนเขียนเว็บ สอนเขียนเว็บ, สอนเขียนโปรแกรม สอนเขียนโปรแกรม, เขียนโปรแกรมราคาถูก เขียนโปรแกรมราคาถูก, แจกระบบ php, แจกโคด php, โปรเจคคอมธุ, โปรเจคคอมพิวเตอร์, โปรเจคคอมพิวเตอร์ธุรกิจ, โปรเจคจบ คอมพิวเตอร์, โปรเจคนักศึกษา, โปรเจควิทยาการคอม Share this entry
Share this entry
  • Share on Facebook
  • Share on Twitter
  • Share on Google+
  • Share on Pinterest
  • Share on Linkedin
  • Share on Tumblr
  • Share on Vk
  • Share on Reddit
  • Share by Mail
https://fordev22.com/wp-content/uploads/2023/04/aj2.jpg 720 1280 fordev22 https://fordev22.com/wp-content/uploads/2018/08/logo_fordev22_2.png fordev222023-04-20 12:45:142023-04-20 13:27:48(2023) PHP+MySqli EP.42 How to AJAX CrudPHP MySqli (Part 2 Update)
You might also like
PHP+MySqli EP.13 การสร้างตัวแปร act และใช้งานร่วมกับ if เพื่อกำหนดเงื่อนไขการเรียกหน้าหรือข้อมูลมาแสดง
สอนทำระบบ POS (ระบบขายหน้าร้าน) Ep 2. รู้จักกับ AdminLTE 3 และ การติดตั้งเพื่อทดลองใช้
PHP+MySqli EP.7 แบ่งหน้าการแสดงข้อมูลออกเป็นหน้าๆ (Simple Pagination)
Bootstrap EP.25 การใส่ Available variations(แถบสีแสดงสถานะ)ในแท็กPHP
Bootstrap EP.8 การทำเว็บไซต์ Responsive ปัจจุบันเว็บไซต์ ได้มีการพัฒนาให้รองรับในทุก ๆ อุปกรณ์
สอน Flutter Ep 1. วิธีติดตั้ง Flutter และ VS Code บน MacOS (สอน Flutter สำหรับผู้เริ่มต้น)
Dreamweaver EP.7 โปรแกรมค้นหาข้อมูลโดยใช้ Dreamweaver CS6
Bootstrap EP.24 Multi value from select/list menu PHP, เพิ่มค่า 2 ค่าขึ้นไป จาก Select/List menu

บริการและผลงาน

  • Home
  • Personal Information
  • คอสเรียนที่เปิดอยู่
  • ตัวอย่าง ผลงานด้านการสอน (สอนสดผ่าน Google Meet, Zoom)
  • บริการ
  • ผลงาน

ช่องทางการติดต่อ

Tel. 090-959-1107

ID Line. fordza4you

E-mail. fordza4you@gmail.com


รับพัฒนาระบบ
รับพัฒนาเว็บแอพพลิเคชั่น
รับพัฒนาเว็บไซต์

Page

Popular
  • (2025) สอน ใช้งาน Telegram Bot API เพื่อการแจ้งแตือนข้อความ...February 28, 2025 - 10:48 pm
  • Computer Tip EP.2 การปรับเสียง...October 13, 2016 - 10:13 pm
  • Dreamweaver EP.1 ลงโปรแกรมจำลอง...October 15, 2016 - 9:28 pm
  • Dreamweaver EP.2 สร้าง Database ด้วย ...October 16, 2016 - 12:48 pm
  • Dreamweaver EP.3 การสร้างที่เก็บเว็บไซต์และสร้าง...October 16, 2016 - 6:33 pm
Recent
  • (2025) สอน ใช้งาน Telegram Bot API เพื่อการแจ้งแตือนข้อความ...February 28, 2025 - 10:48 pm
  • (2025) สอน ใช้งาน Telegram Bot API เพื่อการแจ้งแตือนข้อความ...February 22, 2025 - 1:39 pm
  • (2025) สอน ใช้งาน Telegram Bot API เพื่อการแจ้งแตือนข้อความ...February 21, 2025 - 10:19 pm
  • (2025) สอน ใช้งาน Telegram Bot API เพื่อการแจ้งแตือนข้อความ...February 20, 2025 - 4:21 pm
  • สอน Flutter Ep 4. ติดตั้ง SDK Simulator...June 7, 2023 - 1:54 pm
Comments
  • sssssMay 4, 2017 - 11:52 am by fordev22
  • sssssMay 4, 2017 - 11:50 am by fordev22
  • Awaiting BACS payment Order status changed from Pending...March 1, 2017 - 9:23 am by WooCommerce
Tags
Bootstrap Database Datatable Datatable Serverside Dreamweaver Flutter beginner course Flutter coding for beginners Flutter tutorial Learn Flutter php php+sqli php+sqli php+sqli Point of Sale Point of SalePOS POS POS System POS System showe Sqli sqli xampp กับ dreamweaver ฟรีโปรเจคนักศึกษา ฟอร์ม php รับพัฒนาระบบ รับพัฒนาระบบ รับเขียนโปรแกรม รับเขียนโปรแกรม สอน bootstrap สอน php สอน php mysql สอน php mysqli สอน php พื้นฐาน สอน php เบื้องต้น สอนทำเว็บ สอนทำเว็บ สอนทำเว็บ สอนพัฒนาระบบ สอนพัฒนาระบบ สอนเขียนเว็บ สอนเขียนเว็บ สอนเขียนเว็บ สอนเขียนโปรแกรม สอนเขียนโปรแกรม เขียนโปรแกรมราคาถูก เขียนโปรแกรมราคาถูก เพิ่มข้อมูล แจกระบบ php แจกโคด php โปรเจคคอมธุ โปรเจคคอมพิวเตอร์ โปรเจคคอมพิวเตอร์ธุรกิจ โปรเจคจบ คอมพิวเตอร์ โปรเจคนักศึกษา โปรเจควิทยาการคอม โปรเจควิทยาการคอม Share this entry โปรเจควิทยาการคอม Share this entry Share this entry

Copyright@2018.fordev22.com

(2023) PHP+MySqli EP.41 How to AJAX CrudPHP MySqli (Part 1 insert AND view... (2023) PHP+MySqli EP.43 How to AJAX CrudPHP MySqli (Part 3 Delete)
Scroll to top