列出表数据,并带有删除每个项目的选项。 [英] Listing table data with an option to delete each individual item.
问题描述
想知道是否有人可以帮我解决PHP,MySQL问题。我是PHP和MySQL全新的
。我一直试图找到一种方法从网页上的表格中找到
列表数据,并在每个单独的项目之后
有一个超链接,允许用户删除列出的信息。可以
有人帮忙吗?
即
姓名年龄性别
------ ------------------------------------
Adam 21 M删除
贝蒂22楼删除
克里斯23米删除
雏菊24楼删除
---- -------------------------------------------------- -------------------------------------------------- ----------------------
(在''Sex''之后删除将是删除整行的超链接>
(行)来自表格。
Was wondering if anyone could help me with a PHP, MySQL problem. I am
completely new to PHP and MySQL. I have been trying to find a way to
list data from a table on a web page and after each individual item
have a hyperlink to allow users to delete the information listed. Can
anyone help?
i.e.
Name Age Sex
------------------------------------------
Adam 21 M delete
Betty 22 F delete
Chris 23 M delete
Daisy 24 F delete
------------------------------------------------------------------------------------------------------------------------------
(delete after ''Sex'' would be the hyperlink to delete that entire line
(row) from the table).
推荐答案
我觉得最好用id号做事。您显示的表格
显然每个记录都有一个主键。所以在php中你做了
sql语句类似
i find it best to do thing with id numbers. the table you have shown
will obviously have a primary key for each record. so in php you do the
sql statement something like
result = mysql_query(" select id,name,age,来自人的性别,
result = mysql_query("select id, name, age, sex from people",
db);
if(
db);
if (
这篇关于列出表数据,并带有删除每个项目的选项。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!