PHP 板


LINE

看板 PHP  RSS
上次我问的那个问题已经切步解决了,谢谢各位,不过现在又碰到了一些问题 请大大能否再帮我看一下程式码是否有错,谢谢。 问题目 问题是,我要进行资料的更新,但却无法进行更新。 member_detail.php <? //include("session.php") // 外挂 session 检查功能 ?> <? // include("up.htm");?> // 外挂网页上方功能列 ?> <? include("sql_connect.php"); include("my_msg.php"); //include("db_func.php"); $sqlstr="select * from admin where `id`='$id' "; mysql_query($sqlstr); //$sqlstr = "SELECT * FROM admin where `id`=\`` "; mysql_real_escape_string($_GET['id']).'\' LIMIT 1'; $res = mysql_query($sqlstr); if (mysql_num_rows($res)>0) // 判断查询结果否有资料, 若有则继续执行 { $row = mysql_fetch_array($res); ?> <form name="regstep1" method="post" action="member_update.php"> <!-- 使用 hidden 将资料用『隐藏』的方式传送出去 //--> <input type="hidden" name="id" value="<?=$row[1]?>"> <BR> <table width="446" border="0" bordercolor="#009900" align="center" cellspacing="0"> <tr> <td> <table width="440" border="0" height="220" align="center" bgcolor="#EEEEEE" cellspacing="0" cellpadding="0"> <tr bgcolor="#009900"> <td colspan="2"> <div align="left"><font color="#FFFFFF">会员资料</font></div> </td> </tr> <tr> <td bgcolor="#00FF33"> <div align="center">帐 号</div> </td> <td height="30" bgcolor="#00FF33"> <div align="left"> <!-- 将查询结果中的使用者名称栏位呈现於网页上, 其中 disabled 是要让使用者无法更动此名称 //--> <input type="text" name="username" size="15" value="<?=$row['username']?>" disabled> </div> </td> </tr> <tr> <td bgcolor="#99FF99" height="30"> <div align="center">密 码 变 更</div> </td> <td height="30" bgcolor="#99FF99"> <div align="left"> <!-- 将查询结果中的密码栏位以 * 号呈现於网页上 //--> <input type="password" name="password" size="20" value="<?=$row['password']?>"> </div> </td> </tr> <tr> <td bgcolor="#00FF33" align="center">姓名: <!-- 将查询结果中的姓栏位呈现於网页上 //--> <!-- 将查询结果中的名栏位呈现於网页上 //--> </td> <td bgcolor="#00FF33" align="left" height="30"> <input type="text" name="name" size="6" value="<?=$row['name']?>"> </td> </tr> <tr bgcolor="#666666"> </tr> <tr bgcolor="#99FF99" height="30"> <td> <div align="center">县 市</div> </td> <td bgcolor="#99FF99" height="30"> <!-- 将查询结果中的地区栏位呈现於网页上 //--> <input type="text" name="local" size="10" value="<?=$row['local']?>"></td> </tr> <tr> </tr> <tr bgcolor="#00FF33" height="30"> <td> <div align="center">地  址</div> </td> <td height="30"> <!-- 将查询结果中的地址栏位呈现於网页上 //--> <input type="text" name="address" size="32" value="<?=$row['address']?>"> </td> </tr> <tr> <td height="30" bgcolor="#99FF99"> <div align="center">电  话</div> </td> <td height="30" bgcolor="#99FF99"> <!-- 将查询结果中的电话栏位呈现於网页上 //--> <input type="text" name="tel" size="10" maxlength="10" value="<?=$row['tel']?>"> </td> </tr> <tr bgcolor="#00FF33"> <td height="30"> <div align="center">msn即时通</div> </td> <td height="30"> <!-- 将查询结果中的职业栏位呈现於网页上 //--> <input type="text" name="msn" value="<?=$row['msn']?>"> </td> </tr> <tr> <td colspan="2" bgcolor="#009900"> <div align="center"> <input type="submit" name="Submit" value="更改会员资讯"> </div> </td> </tr> </table> </td> </tr> </table> </form> <? } else { echo "<script>"; echo "alert(\"无此会员\");"; echo "</script>"; echo "<body onload = \"window.close();\">"; } ?> member_update.php <? include("sql_connect.php"); include("db_func.php"); // 更新 member 资料表的资料 BEGIN $sqlstr = "UPDATE admin SET username='$username',password='$password',name='$name', local='$local',address='$address', tel='$tel' ,msn='$msn' WHERE id='$id'"; mysql_query($sqlstr); //更新 admin 资料表的资料 END echo "<script>"; echo "alert(\"会员资料已更新\");"; echo "</script>"; echo "<body onload = \"window.close();\">"; ?> 请大大帮我看一下,程式码是否有错,谢谢。 --



※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 163.21.84.177
1F:→ yanli2:直接告诉大家错误讯息和列数比较好 10/16 20:37
2F:→ roger70349:可是没出现任何的错误讯息,但是资料库就是无法更改 10/16 22:49
3F:推 yanli2:没有任何错误讯息就表示你的sql查询有错 10/16 22:56
4F:→ yanli2:直接丢到PHPMYADMIN里的SQL执行後看他怎麽说吧 10/16 22:56
5F:→ buganini:前面加个error_reporting(E_ALL); 10/17 13:16







like.gif 您可能会有兴趣的文章
icon.png[问题/行为] 猫晚上进房间会不会有憋尿问题
icon.pngRe: [闲聊] 选了错误的女孩成为魔法少女 XDDDDDDDDDD
icon.png[正妹] 瑞典 一张
icon.png[心得] EMS高领长版毛衣.墨小楼MC1002
icon.png[分享] 丹龙隔热纸GE55+33+22
icon.png[问题] 清洗洗衣机
icon.png[寻物] 窗台下的空间
icon.png[闲聊] 双极の女神1 木魔爵
icon.png[售车] 新竹 1997 march 1297cc 白色 四门
icon.png[讨论] 能从照片感受到摄影者心情吗
icon.png[狂贺] 贺贺贺贺 贺!岛村卯月!总选举NO.1
icon.png[难过] 羡慕白皮肤的女生
icon.png阅读文章
icon.png[黑特]
icon.png[问题] SBK S1安装於安全帽位置
icon.png[分享] 旧woo100绝版开箱!!
icon.pngRe: [无言] 关於小包卫生纸
icon.png[开箱] E5-2683V3 RX480Strix 快睿C1 简单测试
icon.png[心得] 苍の海贼龙 地狱 执行者16PT
icon.png[售车] 1999年Virage iO 1.8EXi
icon.png[心得] 挑战33 LV10 狮子座pt solo
icon.png[闲聊] 手把手教你不被桶之新手主购教学
icon.png[分享] Civic Type R 量产版官方照无预警流出
icon.png[售车] Golf 4 2.0 银色 自排
icon.png[出售] Graco提篮汽座(有底座)2000元诚可议
icon.png[问题] 请问补牙材质掉了还能再补吗?(台中半年内
icon.png[问题] 44th 单曲 生写竟然都给重复的啊啊!
icon.png[心得] 华南红卡/icash 核卡
icon.png[问题] 拔牙矫正这样正常吗
icon.png[赠送] 老莫高业 初业 102年版
icon.png[情报] 三大行动支付 本季掀战火
icon.png[宝宝] 博客来Amos水蜡笔5/1特价五折
icon.pngRe: [心得] 新鲜人一些面试分享
icon.png[心得] 苍の海贼龙 地狱 麒麟25PT
icon.pngRe: [闲聊] (君の名は。雷慎入) 君名二创漫画翻译
icon.pngRe: [闲聊] OGN中场影片:失踪人口局 (英文字幕)
icon.png[问题] 台湾大哥大4G讯号差
icon.png[出售] [全国]全新千寻侘草LED灯, 水草

请输入看板名称,例如:BabyMother站内搜寻

TOP