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 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题