 |
ทำอย่างไร ให้การ update จากปุ่ม Radio ไปเปลี่ยนแปลงข้อมูล สถานะในฐานข้อมูลได้ค่ะ |
|
 |
|
|
 |
 |
|
Code (PHP)
print_r($_POST['weight_status']);
ได้อะไร
|
 |
 |
 |
 |
Date :
2020-10-19 11:30:32 |
By :
mr.v |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ไม่อนุมัติ ค่ะ
|
 |
 |
 |
 |
Date :
2020-10-19 11:42:42 |
By :
Pimpada |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
<input type="radio" name="weight_status" value="ไม่อนุมัติ" <?=($weight_status=='รออนุมัติ' ? '' : 'checked')?> />
ที่หลัง value ใน database ควรใช้ตัวเลข ส่วนการแสดงผล หน้าจอค่อยใช้ ตัวหนังสือ
เช่น 0 = รออนุมัติ 1=อนุมัติ
<input type="radio" name="weight_status" value="1" <?=($weight_status>0 ? 'checked' : '')?> /> อนุมัติ
<input type="radio" name="weight_status" value="0" <?=($weight_status>0 ? '' : 'checked')?> /> รออนุมัติ
นี่ถ้าทำงานแบบ multi language ไปไม่เป็นเลยนะจะบอกให้
ปล. อีกที อย่าใช้เลย @ หน้า function หน้าตัวแปร ตรงนั้น มันเอาไว้ใช้ยามจำเป็น แบบ ไม่ต้องการให้ ให้แสดง error
แต่ในขณะที่เรา develop อยู่แล้วมันจะยังไงล่ะ เออเร่อร์ก็ไม่เห็น จะแก้ไขยังไง
|
ประวัติการแก้ไข 2020-10-19 12:21:15 2020-10-19 12:21:53 2020-10-19 12:26:25
 |
 |
 |
 |
Date :
2020-10-19 12:20:22 |
By :
Chaidhanan |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ปรับการทำงานใหม่ค่ะ คือต้องการให้ update หลาย record พร้อมกัน ของฟิว weight_no เดียวกันค่ะ code นี้ไม่ update ค่ะ
Code (PHP)
<?php include('conn.php'); ?>
<center>
<button type="submit" name="confirm" class="btn btn-info">สรุปรายการ</button>
<br/>
<br/>
</center>
<script src='insert.js'></script>
<?php
}
?>
<?php
if(isset($_POST['confirm']))
{
$sqli=" update tb_weight";
$sqli.=" set";
$sqli.=" weight_status='อนุมัติ'";
$sqli.=" where";
$sqli.=" weight_no='$weight_no'";
$sqli.=" and";
$sqli.=" weight_status='รออนุมัติ'";
if($cls_con->write_base($sqli)==true){
echo $cls_con->show_message('อนุมัติสำเร็จ');
echo $cls_con->goto_page(1,'show_pr.php');
}
else{
echo $cls_con->show_message('อนุมัติไม่สำเร็จ');
}
}
?>

และ code insert.js ค่ะ
Code (JavaScript)
$('.myform').submit(function(){
// `this` is the instance of myForm class the event occurred on
var $form = $(this),
url = $form.attr('action'),
data = $form.serializeArray(); // or use serialize() which is more common
$.post( url, data, function(result){
// look inside this form instance for element to populate
$form.find('.result').html(result);
});
return false;
});
|
 |
 |
 |
 |
Date :
2020-10-22 18:41:27 |
By :
Pimpada |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ไล่ไปที่ละเสตป
...
...
...
$sqli.=" weight_status='รออนุมัติ'";
echo $sqli; exit;
เช็คก่อนว่า statement มันถูกต้องไหม
|
 |
 |
 |
 |
Date :
2020-10-22 19:20:11 |
By :
Chaidhanan |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Form แบบเต็มค่ะ
Code (PHP)
<?php include('conn.php'); ?>
<style type="text/css">
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
เพิ่มข้อมูล
</h1>
</section>
<!-- Main content -->
<section class="content">
<form class="form-horizontal" method="post" >
<div class="box-body">
<script>
function findproduct_current(str)
{
if (str.length == 0) {
document.getElementById("pro_weight").innerHTML = "";
return;
} else {
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
document.getElementById("pro_weight").value = xmlhttp.responseText;
var qty= xmlhttp.responseText;
}
}
xmlhttp.open("GET", "find_weight.php?id="+str, true);
xmlhttp.send();
findprono(str);
}
}
function findprono(str)
{
if (str.length == 0) {
document.getElementById("pro_no").innerHTML = "";
return;
} else {
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
document.getElementById("pro_no").value = xmlhttp.responseText;
var qty= xmlhttp.responseText;
}
}
xmlhttp.open("GET", "find_prono.php?id="+str, true);
xmlhttp.send();
findunit(str);
}
}
function findunit(str)
{
if (str.length == 0) {
document.getElementById("weight_unit").innerHTML = "";
return;
} else {
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
document.getElementById("weight_unit").value = xmlhttp.responseText;
var qty= xmlhttp.responseText;
}
}
xmlhttp.open("GET", "find_unit.php?id="+str, true);
xmlhttp.send();
findprice(str);
}
}
function findprice(str)
{
if (str.length == 0) {
document.getElementById("pro_price").innerHTML = "";
return;
} else {
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
document.getElementById("pro_price").value = xmlhttp.responseText;
var qty= xmlhttp.responseText;
}
}
xmlhttp.open("GET", "find_productprice.php?id="+str, true);
xmlhttp.send();
findmember(str);
}
}
function findmember(str)
{
if (str.length == 0) {
document.getElementById("member_fname").innerHTML = "";
return;
} else {
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
document.getElementById("member_fname").value = xmlhttp.responseText;
var qty= xmlhttp.responseText;
}
}
xmlhttp.open("GET", "find_member.php?id="+str, true);
xmlhttp.send();
}
}
function caltotal()
{
var pro_price;
var pro_weight;
var weight_qty;
var weight_total;
var tot;
var tot2;
var dis;
var dis2;
var dis3;
pro_price=document.getElementById("pro_price").value;
pro_weight=document.getElementById("pro_weight").value;
weight_qty=document.getElementById("weight_qty").value;
tot2=pro_price*1;
tot=pro_price*weight_qty;
tot5=pro_weight*weight_qty;
weight_total=tot5;
document.getElementById("weight_total").value=weight_total;
document.getElementById('weight_total').value=parseFloat(document.getElementById('weight_total').value).toFixed(2)
}
</script>
<?php
$sqlw=" select distinct(weight_no) from tb_weight";
$sqlw.=" where";
$sqlw.=" weight_status='อนุมัติ'";
$numw=$cls_con->select_numrows($sqlw);
if($numw==0)
{
$weight_no="Adis-";
}
else
{
$numw=$numw+1;
$weight_no="Adis-".$numw;
}
?>
<div class="form-group">
<label for="weight_no" class="col-sm-2 control-label">หมายเลขใบ สั่งซื้อ</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="weight_no" value="<?=$weight_no;?>" id="weight_no" placeholder="หมายเลขใบ PO">
</div>
</div>
<div class="form-group">
<label for="pro_id" class="col-sm-2 control-label">ชื่อสินค้า *</label>
<div class="col-sm-8">
<select name="pro_id" id="pro_id" required="required" class="form-control" onchange="findproduct_current(this.value)">
<option value="">
--เลือกเพื่อแสดงข้อมูลจำนวนและราคา--
</option>
<?php
$sqld=" select * from tb_product";
if(isset($_GET['pro_id']))
{
$pro_id=$_GET['pro_id'];
$sqld.=" where";
$sqld.=" pro_id='$pro_id'";
}
$resultd=$cls_con->select_base($sqld);
while($rowd=mysqli_fetch_array($resultd))
{
$pro_id=$rowd['pro_id'];
$pro_name=$rowd['pro_name'];
?>
<option value="<?=$pro_id;?>">
<?=$pro_name;?>
</option>
<?php } ?>
</select>
</div>
</div>
<div class="form-group">
<label for="pro_no" class="col-sm-2 control-label">รหัสสินค้า</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="pro_no" id="pro_no" readonly placeholder="">
</div>
</div>
<div class="form-group">
<label for="pro_weight" class="col-sm-2 control-label">น้ำหนัก กก.</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="pro_weight" id="pro_weight" readonly placeholder="น้ำหนัก">
</div>
</div>
<div class="form-group">
<label for="weight_unit" class="col-sm-2 control-label">หน่วย</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="weight_unit" id="weight_unit" readonly placeholder="หน่วย">
</div>
</div>
<div class="form-group">
<label for="pro_price" class="col-sm-2 control-label">ราคาต่อหน่วย</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="pro_price" id="pro_price" readonly placeholder="ราคาต่อหน่วย">
</div>
</div>
<div class="form-group">
<label for="weight_qty" class="col-sm-2 control-label">จำนวนที่ PR *</label>
<div class="col-sm-10">
<input type="number" class="form-control" required name="weight_qty" id="weight_qty" placeholder="ใส่จำนวนที่ต้องการ" onchange="caltotal()" required>
</div>
</div>
<div class="form-group">
<label for="weight_total" class="col-sm-2 control-label">น้ำหนักรวม กก.</label>
<div class="col-sm-10">
<input readonly="number" class="form-control" name="weight_total" id="weight_total" placeholder="">
</div>
</div>
<div class="form-group">
<label for="member_id" class="col-sm-2 control-label">Supplier</label>
<div class="col-sm-10">
<input readonly="text" value="<?=$_SESSION['member_fname'];?>" class="form-control">
<input type="hidden" value="<?=$_SESSION['member_id'];?>" class="form-control" name="member_id" id="member_id">
</div>
</div>
<div class="form-group">
<label for="employee_id" class="col-sm-2 control-label">ผู้ทำใบ PR</label>
<div class="col-sm-10">
<input readonly="text" value="<?=$_SESSION['name'];?>" class="form-control">
<input type="hidden" value="<?=$_SESSION['id'];?>" class="form-control" name="employee_id" id="employee_id">
</div>
</div>
</div>
<!-- /.box-body -->
<center>
<button type="submit" name="submit" class="btn btn-info">บันทึกรายการนี้</button>
<input name="reset" type="reset" id="reset" value="ยกเลิก" onClick="window.location.href='show_product.php';" class="btn btn-warning">
</center>
</form>
<div class="form-group">
<div class="col-sm-10">
</div>
</div>
<div class="form-group">
<div class="col-sm-10">
<center>
<input class="btn btn-primary" type="button" value="เพิ่มรายการต่อ" onclick="window.location.href='show_productpr.php'" />
<br/>
<br/>
</center>
</div>
</div>
<div class="form-group">
<div class="col-sm-10">
</div>
</div>
<?php
if(isset($_POST['submit']))
{
$weight_no=$_POST['weight_no'];
$pro_id=$_POST['pro_id'];
$pro_weight=$_POST['pro_weight'];
$pro_no=$_POST['pro_no'];
$pro_price=$_POST['pro_price'];
$weight_unit=$_POST['weight_unit'];
$weight_qty=$_POST['weight_qty'];
$weight_total2=$_POST['weight_total2'];
$weight_total=$_POST['weight_total'];
$weight_total3=$_POST['weight_total3'];
$member_id=$_POST['member_id'];
$weight_refer=$_POST['weight_refer'];
$employee_id=$_POST['employee_id'];
$weight_status='รออนุมัติ';
$sql=" insert into tb_weight (weight_no,pro_id,pro_no,pro_weight,pro_price,weight_unit,weight_qty,weight_total2,weight_total,weight_refer,weight_total3,member_id,employee_id,weight_status,weight_date)";
$sql.=" values ('$weight_no','$pro_id','$pro_no','$pro_weight','$pro_price','$weight_unit','$weight_qty','$weight_total2','$weight_total','$weight_refer','$weight_total3','$member_id','$employee_id','$weight_status',now())";
if($cls_con->write_base($sql)==true){
echo $cls_con->show_message('บันทึกข้อมูลสำเร็จ');
}
else{
echo $cls_con->show_message('บันทึกข้อมูลไม่สำเร็จ');
}
}
?>
<br/>
<?php
$sqlg=" select * from weight_vw2";
$sqlg.=" where weight_status='รออนุมัติ'";
$numg=$cls_con->select_numrows($sqlg);
if($numg>=1)
{
?>
<form method="post">
<div class="CSSTableGenerator" >
<table >
<tr>
<td>รหัส PR</td>
<td>หมายเลขใบ PR</td>
<td>ชื่อสินค้า</td>
<td>รหัสสินค้า</td>
<td>รูป</td>
<td>ราคาขาย</td>
<td>จำนวน</td>
<td>หน่วย</td>
<td>ราคารวม</td>
<td>โดย</td>
<td>ชื่อลูกค้า</td>
<td>สถานะ</td>
<td>วันที่ทำใบ PR</td>
<td>ลบ</td>
</tr>
<?php
$result=$cls_con->select_base($sqlg);
while($row =mysqli_fetch_array($result))
{
?>
<tr>
<td><?=$row['weight_id'];?></td>
<td><?=$row['weight_no'];?></td>
<td><?=$row['pro_name'];?></td>
<td><?=$row['pro_no'];?></td>
<td><img src="../upload/<?=$row['pro_pic1'];?>" width="50"></td>
<td><?=$row['pro_price'];?></td>
<td><?=$row['weight_qty'];?></td>
<td><?=$row['weight_unit'];?></td>
<td><?=$row['weight_total'];?></td>
<td><?=$row['employee_name'];?></td>
<td><?=$row['member_fname'];?></td>
<td><?=$row['weight_status'];?></td>
<td><?=$row['weight_date'];?></td>
</tr>
<?php } ?>
</table>
</div>
<hr/>
<center>
<button type="submit" name="confirm" class="btn btn-info">สรุปรายการ</button>
<br/>
<br/>
</center>
</form>
<script src='insert.js'></script>
<?php
}
?>
<?php
if(isset($_POST['confirm']))
{
$sqli=" update tb_weight";
$sqli.=" set";
$sqli.=" weight_status='อนุมัติ";
$sqli.=" where";
$sqli.=" weight_no='$weight_no'";
$sqli.=" and";
$sqli.=" weight_status='รออนุมัติ'";
if($cls_con->write_base($sqli)==true){
echo $cls_con->show_message('อนุมัติสำเร็จ');
echo $cls_con->goto_page(1,'show_pr.php');
}
else{
echo $cls_con->show_message('ยอนุมัติไม่สำเร็จ');
}
}
?>
</section>
<!-- /.content -->
</div>
<!-- เนื้อหา -->
<?php include('footer.php'); ?>
|
 |
 |
 |
 |
Date :
2020-10-27 13:29:59 |
By :
Pimpada |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
รูปแบบที่เขียนเนี่ย ค่อนข้างเก่าเลยนะครับ คำสั่งมันยาวเกินไป แนะนำให้ใช้ ajax&jquery รูปแบบ json ดีกว่าคับ
เข้าใจง่ายกว่า คำสั่งสั้นกว่า
https://www.thaicreate.com/community/jquery-ajax-json.html
แล้วก็ที่จะแนะนำ
error response 200 , 400 , 401 ไรพวกนี้ใช้การเปรียบเทียบแบบ === จะดีกว่า
|
 |
 |
 |
 |
Date :
2020-10-27 14:41:24 |
By :
Genesis™ |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ถาม จขกท ก่อน ได้โหลด jquery framework มาใช้หรือเปล่า แต่คิดว่าน่าจะโหลดมาเพราะ เห็น คลาส เป็น boostrap ซึ่งน่าจะต้องใช้ jquery
ถ้าโหลดมาใช้ ก็เปลี่ยนไปใช้ ตาม คุณ Genฯ บอกครับ แต่ถ้าไม่ได้โหลดมาใช้ ใช้แบบนี้ คล่องก็ใช้ไป
ไม่ต้องหนัก bandwidth และหน่วยความจำ ด้วย แต่น่าจะเขียนเป็นฟังชั่น เอาไว้ จะได้ง่ายสดวกเวลาใช้
|
 |
 |
 |
 |
Date :
2020-10-27 16:09:02 |
By :
Chaidhanan |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
insert.js
$(document).ready(function(){
$('form').submit(function(){ // เนื่องจากมีสอง form ควรใส่ id ด้วย เวลาใช้ selector ก็ $('#formID')
var data = $(this).serializeArray();
var submit = $('form').index($(this)) == 0 ? "submit" : "confirm";
data.push({name:submit, value:1}); // เพิ่มค่า submit/confirm เพื่อเช็คที่ server script
//alert(JSON.stringify(data));
$.ajax
({
//url: '', // POST หน้าเดิมไม่ต้องมี url
data: data,
type: 'POST',
success: function(result)
{
// จะทำอะไรกับ Response data ถ้าจะโชว์ ต้อง Clean header buffer + exit() จาก server
//$('#demo').html(result);
//alert(result);
}
});
return false;
});
});
script ด้านบนเป็นแค่วิธีแก้ปัญหาเฉพาะกิจ...เพื่อให้รู้ว่าอัปเดตในฐานข้อมูลได้หรือไม่
เมื่อผ่านแล้วควรแยกเพจ confirm ออกจากหน้า "เพิ่มข้อมูล" เหมือนเดิม
|
 |
 |
 |
 |
Date :
2020-10-29 11:39:41 |
By :
PhrayaDev |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณทุกท่านนะค่ะ mr.v Chaidhanan Genesis พระยาเทพ กำลังเขียน Code ใหม่ ตามคำแนะนำค่ะ ต้องค่อย ๆ สร้างที่ละ step ค่ะ
|
 |
 |
 |
 |
Date :
2020-10-30 11:14:37 |
By :
Pimpada |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
รู้ปัญหาแล้วค่ะ แต่ยังไม่มีประสบการณ์ที่จะแก้ คือ ส่วน Code นี้ตั้งต้นให้ Get เลขที่ อัตโนมัติ เมื่อบันทึกแล้ว ให้ + 1 เพื่อ Run ใบต่อไป
แต่ต้องการให้ key อิสระทำอย่างไรค่ะ
Code (PHP)
<?php
$sqlw=" select distinct(weight_no) from tb_weight";
$sqlw.=" where";
$sqlw.=" weight_status='อนุมัติ'";
$numw=$cls_con->select_numrows($sqlw);
if($numw==0)
{
$weight_no="Adis-";
}
else
{
$numw=$numw+1;
$weight_no="Adis-".$numw;
}
?>
<div class="form-group">
<label for="weight_no" class="col-sm-2 control-label">หมายเลขใบ สั่งซื้อ</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="weight_no" value="<?=$weight_no;?>" id="weight_no" placeholder="หมายเลขใบ PO">
</div>
</div>
code ด้านบน สัมพันธ์กับการกดยืนยัน Status ของ code ด้านล่างค่ะ
Code (PHP)
<center>
<button type="submit" name="confirm" class="btn btn-info">สรุปรายการ</button>
<br/>
<br/>
</center>
</form>
<script src='insert.js'></script>
<?php
}
?>
<?php
if(isset($_POST['confirm']))
{
$sqli=" update tb_weight";
$sqli.=" set";
$sqli.=" weight_status='อนุมัติ";
$sqli.=" where";
$sqli.=" weight_no='$weight_no'";
$sqli.=" and";
$sqli.=" weight_status='รออนุมัติ'";
if($cls_con->write_base($sqli)==true){
echo $cls_con->show_message('อนุมัติสำเร็จ');
echo $cls_con->goto_page(1,'show_pr.php');
}
else{
echo $cls_con->show_message('ยอนุมัติไม่สำเร็จ');
}
}
?>
|
 |
 |
 |
 |
Date :
2020-10-30 18:10:45 |
By :
Pimpada |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลบในแท็ก PHP แล้วใส่ value="" หรือ ลบออกไปเลย
<div class="form-group">
<label for="weight_no" class="col-sm-2 control-label">หมายเลขใบ สั่งซื้อ</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="weight_no" value="" id="weight_no" placeholder="หมายเลขใบ PO">
</div>
</div>
Code (PHP)
<center>
<button type="submit" name="confirm" class="btn btn-info">สรุปรายการ</button>
<br/>
<br/>
</center>
</form>
<script src='insert.js'></script>
<?php
}
?>
<?php
if(isset($_POST['confirm']) && isset($_POST['weight_no']) && !empty($_POST['weight_no']))
{
$sqli=" update tb_weight";
$sqli.=" set";
$sqli.=" weight_status='อนุมัติ";
$sqli.=" where";
$sqli.=" weight_no=$_POST['weight_no']"; // ตรงนี้
$sqli.=" and";
$sqli.=" weight_status='รออนุมัติ'";
if($cls_con->write_base($sqli)==true){
echo $cls_con->show_message('อนุมัติสำเร็จ');
echo $cls_con->goto_page(1,'show_pr.php');
}
else{
echo $cls_con->show_message('ยอนุมัติไม่สำเร็จ');
}
}
?>
เพิ่มใน insert.js
//...
data.push({name:submit, value:1});
data.push({name:"weight_no", value:$("#weight_no").val()}); // ตรงนี้
//...
|
ประวัติการแก้ไข 2020-10-30 20:31:23 2020-10-30 20:31:48
 |
 |
 |
 |
Date :
2020-10-30 20:16:24 |
By :
PhrayaDev |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณ พระยาเทพ มากค่ะ
Error บรรทัดนี้ค่ะ
Code (PHP)
$sqli.=" weight_no=$_POST['weight_no']"; // ตรงนี้
Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in insert_pr.php on line 395
|
 |
 |
 |
 |
Date :
2020-10-31 14:08:01 |
By :
Pimpada |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ว่าแล้วต้องติดปัญหานี้...
ไหนๆ ก็อยู่ develop mode ลองแบบนี้ดูครับ ยังไม่ต้องสนเข็มฉีดยา
Code (PHP)
if(isset($_POST['confirm']) && isset($_POST['weight_no']) && !empty($_POST['weight_no']))
{
$weight_no = $_POST['weight_no'];
$sqli=" update tb_weight";
$sqli.=" set";
$sqli.=" weight_status='อนุมัติ";
$sqli.=" where";
$sqli.=" weight_no='$weight_no'";
$sqli.=" and";
$sqli.=" weight_status='รออนุมัติ'";
|
 |
 |
 |
 |
Date :
2020-10-31 14:32:11 |
By :
PhrayaDev |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
กำลังศึกษา ทำส่งอาจารย์
หรือ กำลังศึกษาใช้งานจริง
ถ้าทำส่งอาจารย์ ทำไปเหอะอะไรก็ได้ แค่ให้รู้ โครงสร้าง วิธีการ ตอบปัญหาได้
แต่ถ้าใช้งานจริง อ่าน comment ข้างบน (mr.v) ให้เยอะๆ
ไม่อย่างนั้นเดี่ยวระบบการเงิน ระบบลูกค้า ของเราจะกลายเป็นของคนอื่น
|
 |
 |
 |
 |
Date :
2020-11-01 07:34:10 |
By :
Chaidhanan |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
พัฒนาต่อไม่ได้เลย ตอนนี้โดนแฮกเว็บไซต์ อยู่ค่ะ ต้องหาทางป้องกันระบบส่วนใหญ่ที่ขึ้นไปแล้วค่ะ
|
 |
 |
 |
 |
Date :
2020-11-06 19:03:35 |
By :
Pimpada |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ปัจจุบัน ใช้ แบบนี้อยู่ ต้องแก้ไขอย่างไรค่ะ
Code (PHP)
<?php
$servername = "localhost";
$username = "xxxxxxx";
$password = "xxxxxxx";
$dbname = "xxxxxx";
$conn = new mysqli($servername, $username, $password, $dbname);
mysqli_set_charset($conn,"utf8");
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
?>
|
 |
 |
 |
 |
Date :
2020-11-06 19:13:16 |
By :
Pimpada |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณสำหรับคำแนะนำ ของคุณ mr.v Chaidhanan ค่ะ จะนำไปปรับเว็บไซต์ค่ะ
|
 |
 |
 |
 |
Date :
2020-11-09 08:42:21 |
By :
Pimpada |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|