Home > Backend Development > PHP Tutorial > = - 求大神帮忙 多谢呢

= - 求大神帮忙 多谢呢

WBOY
Release: 2016-06-13 12:19:43
Original
812 people have browsed it

= - 求大神帮忙 谢谢呢 ~


我想点击编辑按钮后能获取到这一条表单的ID 并且打印出来 ,请问改如何去做呢  
------解决思路----------------------
如果你的每一行的数据都是从数据库中读出来的,那么不出意外,你的每一行都应该有一个id的,所以你只需要把id传给编辑的按钮就可以了,这应该跟表单没有多大关系,因为id数据是从数据库读取的而不是从DOM中获取的。。
比如:
$data = array(
     array('id' => 1, 'other_data'=>'xxxxxxx'),//行1
     array('id' => 2, 'other_data' => 'yyyyyy'),//行2
);
//伪代码
foreach($data as $row){
">编辑    
}
------解决思路----------------------
走数据库的话就这么来
$a=query('select*from `表名`');
while($b=mysql_fetch_assoc($a)){
// echo $b['id'];
echo 编辑
 
}

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template