php - Issues updating record using mysqli -


i want update/edit user form, when click "edit" button, i'm not getting expected results. should display new data, displays old data instead.

coding:

<?php   include"errorreporting.php";  include "conn.php";  $conn = connect();  $conndb = connectdb();  $wardid = $_request["wardid"]; $requestname = $_request["requestname"]; $department = $_request["department"]; $position = $_request["position"]; $date= $_request["date"]; $typeofrequest = $_request["typeofrequest"]; $pleasespecify = $_request["pleasespecify"]; $daterequire = $_request["daterequire"]; $datereturn = $_request["datereturn"];  mysqli_select_db($conn,"misadmin") or die ($conn->error ."\n"); $query = "select * requestform"; $result2= $conn->query($query) or die ($conn->error ."\n"); $row_result =mysqli_fetch_assoc($result2);  mysqli_select_db($conn,"misadmin") or die ($conn->error ."\n"); $conn ->query("update requestform set requestname='$requestname',department='$department',position='$position',date='$date',typeofrequest='$typeofrequest',pleasespecify='$pleasespecify',daterequire='$daterequire',datereturn='$datereturn' wardid='$wardid'",$conn->affected_rows);  $result_update=mysqli_fetch_assoc($result);    header("location:requestform3.php"); ?> 

output: this edit page

update new record

did not change anything

try it:

$conn ->query("update requestform set requestname='$requestname',department='$department',position='$position',date='$date',typeofrequest='$typeofrequest',pleasespecify='$pleasespecify',daterequire='$daterequire',datereturn='$datereturn' wardid=$wardid "); 

Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -