Guest User

Untitled

a guest
May 16th, 2018
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  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. }
Add Comment
Please, Sign In to add comment