douba9654 2016-11-24 12:04
浏览 237

如何在jquery中传递php参数

From Here I am doing like I fetch data from database and display in table format still it is working fine, after I click the division_edit() function I want pass the value (id),how can do this.

<table id="dataTable" class="table table-bordered table-hover">
  <thead>
    <tr>
      <th>S.No</th>
      <th>Division</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <?php $sql=m ysql_query( "SELECT * FROM division WHERE status !='1'"); for($i=1;$row=m ysql_fetch_assoc($sql);$i++){ ?>
    <tr role="row" class="odd">
      <td>
        <?php echo $i;?>
      </td>
      <td>
        <?php echo $row[ 'division'];?>
      </td>
      <td><a class="btn btn-success btn-xs" href="state_edit.php?id=<?php echo base64_encode($row['id']);?>" onclick="division_edit()" id="division_edit"><i class="fa fa-pencil-square-o"></i> Edit</a> 
        <button class="btn btn-danger btn-xs" data-href="state_delete.php?id=<?php echo base64_encode($row['id']);?>"
        data-toggle="modal" data-target="#confirm-delete"><i class="fa fa-trash"></i> Delete</button>
      </td>
    </tr>
    <?php } ?>
  </tbody>

  <tfoot>
    <tr>
      <th>S.No</th>
      <th>Division</th>
      <th>Action</th>
    </tr>
  </tfoot>
</table>

</div>
  • 写回答

2条回答 默认 最新

  • dongmei3498 2016-11-24 12:08
    关注

    May this help you:

    <table id="dataTable" class="table table-bordered table-hover">
      <thead>
        <tr>
          <th>S.No</th>
          <th>Division</th>
          <th>Action</th>
        </tr>
      </thead>
      <tbody>
        <?php $sql=m ysql_query( "SELECT * FROM division WHERE status !='1'"); for($i=1;$row=m ysql_fetch_assoc($sql);$i++){ ?>
        <tr role="row" class="odd">
          <td>
            <?php echo $i;?>
          </td>
          <td>
            <?php echo $row[ 'division'];?>
          </td>
          <td><a class="btn btn-success btn-xs" href="state_edit.php?id=<?php echo base64_encode($row['id']);?>" onclick="division_edit(<?php echo $row['id']; ?>)" id="division_edit"><i class="fa fa-pencil-square-o"></i> Edit</a> 
            <button class="btn btn-danger btn-xs" data-href="state_delete.php?id=<?php echo base64_encode($row['id']);?>"
            data-toggle="modal" data-target="#confirm-delete"><i class="fa fa-trash"></i> Delete</button>
          </td>
        </tr>
        <?php } ?>
      </tbody>
    
      <tfoot>
        <tr>
          <th>S.No</th>
          <th>Division</th>
          <th>Action</th>
        </tr>
      </tfoot>
    </table>
    
    评论

报告相同问题?

悬赏问题

  • ¥15 r语言蛋白组学相关问题
  • ¥15 Python时间序列如何拟合疏系数模型
  • ¥15 求学软件的前人们指明方向🥺
  • ¥50 如何增强飞上天的树莓派的热点信号强度,以使得笔记本可以在地面实现远程桌面连接
  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 STM32驱动继电器