I want to convert foreach to if statement because mysql query returns only one row.So i want to use if instead of foreach

```
    $db = new db();
    $db -> serverconnection();

    $item = $_GET["name"];

    $query = "SELECT c.firstname,c.phonenumber,c.address FROM `order` o,customerdetails c WHERE o.ordercode = '$item' AND c.sno=o.customerid";

        $results = $db->selectQuery($query);

            foreach ($results as $customerdetails)
            {
                $orderidDetail = $customerdetails['customerid'];
                echo $customerdetails["firstname"];
                echo $customerdetails["phonenumber"];
                echo $customerdetails["address"];       
           }

```