本文介绍了无法将数据更新到数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
数据库无法更新数据,并且
the database cannot update the data and
$customer_id =$_GET[''customer_id''];
在这里是错误的.有人请帮助我:''(
我尝试过的事情:
is error here. someone please help me :''(
What I have tried:
<?php
include "config.php";
$link = mysqli_connect($h ,$u ,$p,$db);
$customer_id =$_GET[''customer_id''];
$sql="select*from customer where customer_id=''$customer_id'' ";
$result=mysqli_query($link,$sql);
$check =mysqli_fetch_array($result);
if (isset($_POST[''done'']))
{
$cuname=$_POST[''cuname''];
$phoneno=$_POST[''phoneno''];
$email=$_POST[''email''];
$address=$_POST[''address''];
$sql="update customer set cuname=''$cuname'',phoneno=''$phoneno'',email=''$email'',address=''$address'' where customer_id=''$customer_id''";
if(!$sql)
{
echo "error";
}
else {
echo "try again" ;
}
}
?>
<html>
<form method=post onsubmit="return check()" >
<input type="text" name="cuname" value="<?php echo $check[''cuname''];?>" placeholder="name">
<input type="text" name="phoneno" value="<?php echo $check[''phoneno''];?>" placeholder="phoneno">
<input type="text" name="email" value="<?php echo $check[''email''];?>" placeholder="email">
<input type="text" name="address" value="<?php echo $check[''address''];?>" placeholder="address">
<input type="submit" name="done" >
</form>
</html>
<a href="home.html">Home</a>
推荐答案
是错误的.有人请帮助我:''(
我尝试过的事情:
is error here. someone please help me :''(
What I have tried:
<?php
include "config.php";
这篇关于无法将数据更新到数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!