-3
while($s=mysql_fetch_row($q))
{
echo "<table width=90% bgcolor='#6CDAF5' align=center>
    <tr><th align=left> Bug $i: </tr>
    <tr><td>Username: <td> $s[0] </td></tr>
    <tr><td>User email-id: <td>$s[1] </td></tr>
    <tr><td>User Contact-no :<td>$s[2] </td></tr>
    <tr><td>Bug: <td><textarea rows=5 cols=40 name=bug>$s[3]</textarea></td></tr>
    <tr><td>Bug-Reason: <td><textarea rows=5 cols=40  name=text1>$s[4]</textarea></td></tr>
    <tr><td>Bug-Solution:<td><textarea rows=5 cols=40 name=text2>$s[5]</textarea></td></tr>
    <tr><td>Updated-date:<td><input type=text value='$s[6]' name=date></td></tr>
    <tr><td width=100% align=right colspan=2><input type=button name=addbug value='add this bug with main bugs' OnClick=validate()><input type=button name=delete value='delete this bug' OnClick=delete()></tr>
    </table><br>";
    $i++;
}

在这里,我使用 select * from Troubleshoot 从数据库中获取所有行;查询...每个表格都包含两个按钮..在浏览器中显示表格后,单击按钮时我只获取最后一个表格值..如何在单击按钮时获取相应的按钮值

4

1 回答 1

1

You want to be able to get the id when deleting?

try something like,

OnClick=delete('".$i."')

and

OnClick=validate('".$i."')
于 2013-05-01T05:19:40.537 回答