Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. public function some_function($accId){
  2. $q = DB::Select("SELECT ca.*, ch.* FROM credit_accounts as ca, credit_history as ch WHERE ch.acc_id=ca.id AND ch.acc_id='$accId' ORDER BY ch.acc_id DESC");
  3.  
  4. if (count($q) > 0){
  5. // if query fetch some data, then this if condition works fine
  6. $val="condition true";
  7. }
  8. else{
  9. // if there is no data against this query then else block not runs and return "readyState": 4 error. but it should return "condition false".
  10. $val = "condition false";
  11. }
  12.  
  13. return $val;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement