Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function myfunction(){
- $query ="SELECT * from tbl_data";
- $stmt = $this->getConnection()->prepare($query);
- $stmt->execute();
- foreach ($stmt->fetchAll() as $value) {
- //custom value
- $customval = 1;
- $array = array([
- "ID" => $value['ID'],
- "name" => $value['name'],
- "staus" => $value['status'],
- "customval" => $customval,
- ]);
- }
- return $array;
- }
Add Comment
Please, Sign In to add comment