daily pastebin goal
79%
SHARE
TWEET

Untitled

a guest May 16th, 2018 102 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function myfunction(){
  2.     $query ="SELECT * from tbl_data";
  3.     $stmt = $this->getConnection()->prepare($query);
  4.     $stmt->execute();
  5.  
  6.     foreach ($stmt->fetchAll() as $value) {
  7.  
  8.         //custom value
  9.         $customval = 1;
  10.  
  11.         $array = array([
  12.             "ID"                => $value['ID'],
  13.             "name"              => $value['name'],
  14.             "staus"             => $value['status'],
  15.             "customval"         => $customval,
  16.         ]);
  17.     }
  18.  
  19.     return $array;
  20. }
RAW Paste Data
Top