如何使用表单和复选框更新表中的数据? [英] How to update data in table using form and a checkbox?

查看:65
本文介绍了如何使用表单和复选框更新表中的数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个PHP脚本,显示表中的所有数据。我希望它在这个数据的每一行旁边都有复选框,所以我可以选中某些条目旁边的复选框,当我点击提交时,有。这些条目的collumn设置为yes。


以下是显示列表的大部分脚本:

I have a php script that shows all the data in a table. I want it to have check boxes next to each line of this data that it puts out, so I can check the boxes next to certain entries, and when I click submit, the "have" collumn for those entries is set to yes.

Here is most of the script that shows the list:

展开 | 选择 | Wrap | 行号

推荐答案

展开 | 选择 | Wrap | 行号


这怎么可能完成?很抱歉,我不太了解数组并循环遍历它们。
And how may that be accomplished? Sorry to say I don''t really understand arrays and looping through them.


flametail。


首先你需要关联一些值使用您的复选框,以便在提交表单时可以阅读此数据。此时,我将假设您的数据库中的行具有与之关联的一些唯一ID。因此,您的复选框将类似于:

Hi, flametail.

Firstly you need to associate some value with your checkboxes so that you can read this data when your form is submit. At this point I will assume that your rows in your database have some unique ID associated with them. So your checkboxes will look something like:

展开 | 选择 | Wrap | 行号


这篇关于如何使用表单和复选框更新表中的数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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