Guest User

Untitled

a guest
Nov 23rd, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. public function getProcResult($returnKeys = array() ){
  2.  
  3. $rows = array();
  4. $this->result = $this->selectprc();
  5. $columns = array();
  6. $key_count = 0;
  7. $first_call = true;
  8. do{
  9. $result_new = $this->result->fetchAll(PDO::FETCH_CLASS);//this is where i am getting the error
  10. if(isset($returnKeys[$key_count])) {
  11. if (count($result_new)) {
  12. //print_r($result_new);
  13. //echo $returnKeys[$key_count];
  14. //echo '<br>=========<br>';
  15. $this->data[$returnKeys[$key_count]] = $result_new;
  16. } else {
  17. $this->data[$returnKeys[$key_count]] = array();
  18. }
  19. }
  20. $key_count++;
  21. }while($this->result->nextRowset());
  22.  
  23. do{
  24. if(isset($returnKeys[$key_count])) {
  25. $this->data[$returnKeys[$key_count]] = array();
  26. }
  27. $key_count++;
  28. }while($key_count<count($returnKeys));
  29.  
  30. return $this;
  31.  
  32. }
  33.  
  34. protected function selectprc(){
  35. $pdo = DB::connection($this->connection)->getPdo();
  36. DB::connection()->logQuery($this->query,array());
  37. return $pdo->query($this->query);
  38. }
Add Comment
Please, Sign In to add comment