foreach( $stmt as $row )
{
echo "<tr>";
echo "<td><button type=button' disabled id='NameButton' name='NameButton' value='".$row['Name']."'>".$row['Name']."</button></td>";
echo "<td>" .$row['Level'] . "</td>";
//echo "<td>" .$row[''] ."</td>";
echo "<td>" .$row['FirstName'] . " " .$row['LastName']. "</td>";
echo "<td> <button id='editClass' name='editClass' value='".$row['ID']."'>რედაქტირება</button> </td>";
echo "<td> <button id='deleteClass'>წაშლა</button> </td>";
echo "</tr>";
}
这是我从DB显示的代码。现在我尝试进行编辑,我需要从这个form (1 => Name , 2 => Button [with ID from DB] )
得到2个值,对于Button它工作正常( i post date )
,但是对于带有DB Post值的按钮不起作用
$ID =$_POST['editClass'];
$name =$_POST['NameButton'];
$date=array(":ID"=>$ID ,":Name"=>$name);
var_dump($date);`
这是我尝试获取日期的方式... var_dump的输出是:
array (size=2)
:ID' => string '132' (length=3)
:Name' => null
答案 0 :(得分:0)
该按钮不会被提交,也不是为输入数据而设计的。使用提交类型更改输入的按钮标记。