• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

脚本更新客户端不工作的mysql

php 来源:razvan 3次浏览

1 – 更新我的mysql客户端脚本 2 – 当我离开(其中id = id“;)我加倍了其他id只是使他们相同的变化。 。客户的个人资料,我知道这个问题,但不知道要放什么东西在那里,我试了MENY选项和仍然无法正常工作, 3 – 这里是我的脚本:脚本更新客户端不工作的mysql

<?php 
include('../conect.php'); 
if(isset($_POST['update'])) 
    // Get values from form 
$id=$_POST['id']; 
$username=$_POST['username']; 
$utilizator=$_POST['utilizator']; 
$password=$_POST['password']; 
$nivel=$_POST['nivel']; 
$departament=$_POST['departament']; 
$location=$_POST['location']; 
$country=$_POST['country']; 
$email=$_POST['email']; 
$ip=$_POST['ip']; 


$query = "UPDATE utilizatori SET username = '$username', utilizator = '$utilizator', password = '$password', nivel = '$nivel', departament = '$departament', location = '$location', country = '$country', email = '$email', ip = '$ip' where id= id"; 
$res = mysql_query($query); 
mysql_query($update); 
    echo $update; 


mysql_query($query); 
echo "Record Updated"; 

header('location:../user.php'); 
// close connection 
mysql_close(); 
?> 


===========解决方案如下:

试试这个:

<?php 
include('../conect.php'); 
if(isset($_POST['update'])){ 
// Get values from form 
$id=$_POST['id']; 
$username=$_POST['username']; 
$utilizator=$_POST['utilizator']; 
$password=$_POST['password']; 
$nivel=$_POST['nivel']; 
$departament=$_POST['departament']; 
$location=$_POST['location']; 
$country=$_POST['country']; 
$email=$_POST['email']; 
$ip=$_POST['ip']; 
    $query = "UPDATE utilizatori SET username = '$username', utilizator = '$utilizator', 
    password = '$password', nivel = '$nivel', departament = '$departament', 
    location = '$location', country = '$country', email = '$email', ip = '$ip' 
    where id= $id"; 
    $res = mysql_query($query); 
    if ($res) { 
    echo "Record Updated"; 
    } else { 
    echo "Record not updated."; 
    } 
    header('location:../user.php'); 
    } // end of first if statement 
    // close connection 
    mysql_close(); 
    ?> 

版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)