if (($row->{'cust_phpx'} != '') && ($row->{'cust_phsx'} != '')) { # # Execute the query # }