<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Insert title here</title>
</head>
<body>
<script type="text/javascript"><?php
date_default_timezone_set('Etc/GMT-8');
//通过post获取页面提交数据信息
$userId = $_POST[userId];
$userName = $_POST[userName];
$userAge = $_POST[userAge];$conn = mysql_connect("127.0.0.1","test","test");//连接数据库
mysql_select_db("data2",$conn);$sql = "update user set UID='".$userName."',tory=".$userAge." where ID='".$userId."'";
mysql_query('set names utf8');
mysql_query($sql,$conn);//执行SQL$ = mysql_affected_rows();//返回影响行数
$url = "1234.php"; if($>0){echo "alert('成功')";}else{
echo "alert('失败')";
}mysql_close($conn);?>window.location= "1234.php";
</script>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Insert title here</title>
</head>
<body>
<script type="text/javascript"><?php
date_default_timezone_set('Etc/GMT-8');
//通过post获取页面提交数据信息
$userId = $_POST[userId];
$userName = $_POST[userName];
$userAge = $_POST[userAge];$conn = mysql_connect("127.0.0.1","test","test");//连接数据库
mysql_select_db("data2",$conn);$sql = "update user set UID='".$userName."',tory=".$userAge." where ID='".$userId."'";
mysql_query('set names utf8');
mysql_query($sql,$conn);//执行SQL$ = mysql_affected_rows();//返回影响行数
$url = "1234.php"; if($>0){echo "alert('成功')";}else{
echo "alert('失败')";
}mysql_close($conn);?>window.location= "1234.php";
</script>
</body>
</html>
解决方案 »
- itunes相关问题
- 正则表达式匹配,并替换部分字符
- 刚开始学php,需要高人指点急呀。。。。。。。。。。。。。
- 如何让DIV垂直居中
- 逆序显示记录
- 怎样实现这样的排名?思路也行
- win2003+iis6+php4有错,烦请看一下!
- ◇◆有用php做过ftp电影网站的吗?进来聊一聊,到时给你电影网站用户名和密码◇◆
- php.ini中upload_max_filesize=32M现上载11M文件不成功,小一点的则可,怎么回事?
- 如果mysql_query里面insert的内容的个数和数据库里面已有的字段数不符会怎样?
- 海量关键词过滤文章,如何实现最高效?
- sql排序问题。请问有一个字段的值有5, 2,和0三种值。如何让2在最前面,然后在排序2数据的id倒叙
$userName = $_POST['userName'];
$userAge = $_POST['userAge'];
$userName = $_POST[userName];
$userAge = $_POST[userAge];
改为$userId = $_POST['userId'];
$userName = $_POST['userName'];
$userAge = $_POST['userAge'];