query($sql); $results = $conn->query($sql); if(!$results) { echo $conn->error; } else { $row = $results->fetch_row(); echo $wanted_result = $row[2]; } $resss = $conn->query($sql); ?>