Sunday, May 12, 2019

PHP Database Class and it's use - Part 3

Adding multiple where clauses

 $args = [  
           'table' => 'tblroundtriptransfer',  
           'data' => [  
                          $colNameAdults                      
                          ],                           
           'where' => [  
                     'idCityFrom' => $idCityFromRoundTrip,  
                ],  
           'and' => [  
                'idCityTo'=> $idCityToRoundTrip,  
           ],  
           ];  
      }  
      $fetch = $db->select($args);  

and array contains the multiple values of the where clause. and it will create the correct SQL Statement.



No comments:

Post a Comment