while循环使用mysqli_fetch_array和提交按钮 [英] While loop using mysqli_fetch_array with submit buttons

查看:112
本文介绍了while循环使用mysqli_fetch_array和提交按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问候,


目前我的代码是按照这种性质安排的,请原谅我这么新,我正在学习! :)所以不要笑我的回声'因为我对表还不太了解。


我遇到的问题是我使用while循环显示5来自mysql数据库的数据行。但是,当我在循环中放置一个提交按钮时,它将正确循环5次,但是当点击任何提交按钮时,它将默认为检索到的最后一行数据的值。


这是我到目前为止的代码。

Greetings,

Currently my code is arranged in this nature, and please excuse me for being so new, I''m learning! :) So no laughing at my echo''s as I don''t know much about tables yet.

The issue I have is that I am using a while loop to display 5 rows of data from the mysql database. However when I put a submit button in the loop it will loop it 5 times properly but when any of the submit buttons are clicked it will default to the values from the last row of data retrieved.

Here''s what I have so far with code.

展开 | 选择 | Wrap | 行号

推荐答案

首先,它是


_POST [''PHP_SELF''] (带引号,否则会发出通知)。


判断你的表格,我会说它默认为没有排,因为它' s 5次完全相同的形式...
_POST[''PHP_SELF''] (with quotes, otherwise a notice is issued).

judging your form, I’d say it defaults to no row, since it’s 5 times exactly the same form …


感谢您看一下,我还在努力弄清楚如何让它运转起来。我不知道如何为循环中的每个输出制作不同的表格。


有什么建议吗?


编辑:忘了提到它默认为最后一行,并在我点击提交时做它应该做的事情。
Thanks for taking a look at it, I''m still trying to figure out how to get it working. I''m not sure how to make a different form for each of the outputs in the loop.

Any suggestions?

Forgot to mention it defaults to the last row and does what it should when I click submit.


这篇关于while循环使用mysqli_fetch_array和提交按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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