Advertisement
dassoubarna

Display Table

Apr 23rd, 2013
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.98 KB | None | 0 0
  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>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement