PHP页面不会更新mysql记录 [英] PHP page won't update mysql record

查看:78
本文介绍了PHP页面不会更新mysql记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

设置:我只有一个数据库,其中包含一个表。 第一页有一个表单,通过PHP将记录(包含6个字段)添加到mySQL数据库的单独表中。这很好用。我还有一个PHP表,在同一页面上显示我数据库中的所有记录。这也很好。我设置了我的表,以便有一个第7个字段,称为rid。充当记录ID的行为或唯一识别领域。这是主要的并且自动递增。在同一页面上有第二种形式,提示用户输入rid。提交一个这样的表单,它加载一个第二个PHP页面,显示rid指定的任何记录的字段。并允许用户编辑它们。

问题:当提交第二个PHP页面的表单时,第三个PHP页面应该更新mySQL表。它......并不是,尽管有回声。

第二页代码:

展开 | 选择 | Wrap | 行号

解决方案

我认为你不需要foreach(


HTTP_POST_VARS as


< blockquote> varname =>


Setup: I only have one database with one table in it. The first page has a form that adds a record (w/ 6 fields in it) to the mySQL database''s lone table via PHP. This works fine. I also have a PHP table that displays all records in my database on this same page. This too works fine. I have my table set up so that there is a 7th field, called "rid" to act as a "record id" or unique identifying field. This is primary and auto-incremented. There is a second form on the same page that prompts the user to enter a "rid". One this form is submitted it loads a second PHP page that displays the fields of whichever record was specified by the "rid" and allows the user to edit them.

Problem: When this second PHP page''s form is submitted, a third PHP page is supposed to UPDATE the mySQL table. It... doesn''t, despite echoing that is has.

Second Page Code:

Expand|Select|Wrap|Line Numbers

解决方案

I don''t think you need the foreach(


HTTP_POST_VARS as


varname =>


这篇关于PHP页面不会更新mysql记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆