Question: I've debated with my friend about the difference between data structure stack and hardware stack(call stack). I thought they are perfectly same because they both have 'push' and 'pop' that can deal with only the latest element. But my friend said that they're not same at all, but they share only the same name, 'stack'. And he thinks so because in call stack, we can access addresses that are not the latest ones, contradicting the definition of stack(data structure). Can you give an answer to this?

Answer: 
```
<?php
 $table='<table>
            <tr>
             <th>Id</th>
             <th>Name</th>
             <th>Serial</th>
           </tr>';

  $servername = "localhost";
  $username = "";
  $password = "";
  $dbname = "verify";

  // Create connection
  $conn = new mysqli($servername, $username, $password, $dbname);

 // Check connection
 if ($conn->connect_error) {
  die("Connection failed: " . $conn->connect_error);
  }

 $result = $conn->query($sql);

  $stack = array();

if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
    array_push($stack, $row);
    if(!$array) {
        return $row;
     }
 }
}

$conn->close();

 $table_content='';
 foreach($stack as $item)
 {
  $table_content.= "<tr>
                     <td>" . $row['ProductId'] . "</td>
                     <td>" . $row['Name'] . " </td>.  
                     <td>" . $row['SerialId'] . "</td>
                   </tr>";

 }
echo $table.$table_content.'</table>';
 ?>

```
```
  <table>
<tr>
    <th>Id</th>
    <th>Name</th>
    <th>Serial</th>
</tr>

<?php

$servername = "localhost";
$username = "";
$password = "";
$dbname = "verify";

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);

// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}

$result = $conn->query($sql);

$stack = array();

if ($result->num_rows > 0) {
    // output data of each row
    while($row = $result->fetch_assoc()) {
        array_push($stack, $row);
        if(!$array) {
            return $row;
        }
    }
}

$conn->close();

foreach($stack as $item)
{
    echo "<tr><td>" . $row['ProductId'] . "</td><td>" . $row['Name'] . "</td>.  <td>" . $row['SerialId'] . "</td></tr>";
}

?>

```