Guest User

Untitled

a guest
Jul 21st, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. function testing_db_viewall($form, &$form_state){
  2. $result = db_select('infobox_new')
  3. ->fields('infobox_new', array('name','emailid','contactno','nid'))
  4. ->execute();
  5.  
  6. $entries = $result;
  7. $output ='';
  8. $rows = array();
  9.  
  10. foreach ($entries as $entry) {
  11. // print_r($entry);
  12. // echo "<br>";
  13. $rows[] = array( $entry->name, $entry->emailid, $entry->contactno, l('edit','examples/edit/'.$entry->nid), );
  14. }
  15. // Make a table for them.
  16. $header = array(t('Name'),t('Email id'), t('Contact No'),t('edit'));
  17. $output .= theme('table', array('header' => $header, 'rows' => $rows));
  18.  
  19. echo $output;
  20. }
Add Comment
Please, Sign In to add comment