php mysqli插入和更新查询 [英] php mysqli insert and update queries

查看:106
本文介绍了php mysqli插入和更新查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个反馈表单,允许用户编写他们的反馈信息,并使用php和mysqli将这些反馈信息存储在基于用户名的数据库中
i确实插入了数据,但没有用户名问题是:
当我写更新查询时,我变得无法插入任何数据,任何人都可以帮助我?

feedback_form.php



 <?php 

session_start();
$ login =($ _SESSION ['login']);
$ userid =($ _SESSION ['user_id']);
$ login_user =($ _SESSION ['username']);
$ fname =($ _SESSION ['first_name']);
$ lname =($ _SESSION ['last_name']);
$ sessionaddres =($ _ SESSION ['address']);
?>
<!DOCTYPE html PUBLIC - // W3C // DTD XHTML 1.0 Transitional // ENhttp://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
< html xmlns =http://www.w3.org/1999/xhtml>
< head>
< meta http-equiv =Content-Typecontent =text / html; charset = utf-8/>
< title>反馈页面< / title>
< script type =text / javascriptsrc =http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js\">< ;; script>
< link href =style / stylesheet.css =stylesheettype =text / css/>
< script type =text / javascript>
$(function(){
$('#submit')。click(function(){
$('#container')。append('< img src =images /loading.gifalt =目前正在加载id =loading/>');
var comment = $('#comments')。val();
$ .ajax({
url:'feedback_process.php',
type:'POST',
data:{comments:comments},
success:function(result){
$('#response')。remove();
$('#container')。append('< p id =response>'+ result +'< / p>') ;
$('#loading')。fadeOut(500,function(){
$(this).remove();
});
}
});
return false;
});
});
< / script>
< / head>
<?php require_once('header.php'); ?>
< body>
< form action =feedback_form.phpmethod =post>
< div id =container>
< h2><?php echo $ login_user?>< / h2>

< label for =评论>评论< / label>