This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Display Table

By: dassoubarna on Apr 23rd, 2013  |  syntax: PHP  |  size: 0.98 KB  |  views: 28  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <button id="btnDeleteRow">Delete</button>
  2. <?php
  3. global $wpdb;
  4. $result = $wpdb->get_results("SELECT * FROM `table`", ARRAY_A);
  5.  
  6. ?>
  7.  
  8. <table border="1" id="tiwari-table" class="tiwari-table">
  9.  
  10. <thead>
  11.                 <tr>
  12.                         <th>State</th>
  13.                         <th>City</th>
  14.                         <th>Tehsil</th>
  15.                         <th>Village</th>
  16.                         <th>Name</th>
  17.                         <th>Ward</th>
  18.                         <th>Address</th>
  19.                         <th>Description</th>
  20.                         <th>Mobile</th>
  21.                        
  22.                 </tr>
  23.         </thead>
  24.         <tbody>
  25. <?php
  26. foreach($result as $row){
  27. ?>
  28.  
  29.  
  30.   <tr id="<?php echo $row[id];?>">
  31.         <td id="state"><?php echo $row[state];?></td>
  32.         <td id="city"><?php echo $row[city];?></td>
  33.         <td id="tehsil"><?php echo $row[tehsil];?></td>
  34.         <td id="village"><?php echo $row[village];?></td>
  35.         <td id="name"><?php echo $row[name];?></td>
  36.         <td id="ward"><?php echo $row[ward];?></td>
  37.         <td id="address"><?php echo $row[address];?></td>
  38.         <td id="description"><?php echo $row[description];?></td>
  39.         <td id="mobile"><?php echo $row[mobile];?></td>
  40.   </tr>
  41.   <?php
  42. }
  43. ?>
  44. </tbody>
  45.   </table>
clone this paste RAW Paste Data