Question: I've just started learning PHP so this is quite a struggle for me, any help is appreciated!

So, I've managed to select my database, table and get data from it. But I need to select more data from the older columns.

Here is some of the code:

```
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}

//execute the SQL query and return records
$result = mysqli_query($conn, "SELECT username FROM interview");

while($rowval = mysqli_fetch_array($result))

 {
   $username= $rowval['username'];
   $username2= $rowval['username'];
   $username3= $rowval['username'];
   $username4= $rowval['username'];

}

?>

```

And I am displaying the data in a button, I want $username to display the first column and $username2 to display the second column etc...

I fetch the data using this code:

```
<?php echo  $username; ?>
<?php echo  $username2; ?>
<?php echo  $username3; ?>
<?php echo  $username4; ?>

```

Thanks!

Answer: 
> 
> In computer science and logic, a dependent type is a type whose definition depends on a value. A "pair of integers" is a type. A "pair of integers where the second is greater than the first" is a dependent type because of the dependence on the value.
> 
> 
> 

So then you can use subtypes to implement them--

```
-- The "pair of integers" from the example.
Type Pair is record
  A, B : Integer;
end record;

-- The "where the second is greater than the first" constraint.
Subtype Constrained_Pair is Pair
  with Dynamic_Predicate => Constrained_Pair.B > Constrained_Pair.A;

```
No, not as I read the formal definition of dependent types you referenced.