dqgg25493 2012-01-16 04:00
浏览 116
已采纳

如何使用表单传递mysql行变量

I have this page where it displays some info from a database here is some code:

while($row = mysql_fetch_array($result))
    {        echo "<tr>";     
echo "<td><form action='deleteitem.php' method='get'><input type='submit'></form>  </td>"; 
echo "<td><textarea name='description' cols='40' rows='8'>" . $row['some_info']"
                  }

I'm not sure how to pass the particular row's id to the action script so that an item can be deleted by the user if they want

  • 写回答

1条回答 默认 最新

  • dongyizhui0616 2012-01-16 04:04
    关注

    You can use hidden input:

    <input type="hidden" name="id" value="<?php echo $row['id'] ?>" />
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 用matlab 设计一个不动点迭代法求解非线性方程组的代码
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试
  • ¥20 问题请教!vue项目关于Nginx配置nonce安全策略的问题
  • ¥15 教务系统账号被盗号如何追溯设备
  • ¥20 delta降尺度方法,未来数据怎么降尺度
  • ¥15 c# 使用NPOI快速将datatable数据导入excel中指定sheet,要求快速高效