Question: Here is [array of objects](https://i.stack.imgur.com/f5Vhs.jpg) from which , i want to get value corresponding to keys , for e.g `"ERROR"` in this case for key `status`. This status may come at any index of array of objects. How do filter throughout array and get key and values.

i have `response` object which gives dynamic array objects from which i can get by using `Object.values(response)[0].responseStatus.status`
for some case `Object.values(response)[0].status` . How do get using programmatically using jquery.

Answer: 
You code is a bit messy but here is what you need to do generally.
First query for the unique record:

```
$sqlQuery = "SELECT id, firstname, lastname FROM Table Where id = '$id'";

```

Then run the query:

```
$result = $connection->query($sqlQuery ); //nb: $connection is your connection variable

```

Then check if any result found:

```
if ($result->num_rows > 0) { ........ }

```

If any records found then put the fetched data in variables like this

```
while($row = $result->fetch_assoc()) {
  $firstname = $row["firstname"];
  $lastname = $row["lastname"];
  //and so on....
}
// You can display these variables any how you want in here, eg:
echo "<h2>$firstname</h2>";

```

or

```
<input type="text" id="firstname" name="firstname" value="<?php echo $firstname ?>" /> 
//nb: you must close the php tag before using html and re open it after

```

if "if ($result->num\_rows > 0) {...} is false, just use an else {...} to display a message
You can run a query with your active connection to fetch your respective information from the table you want, along with a search clause for where the name is equal to a given value.

**Query:**

```php
$result = mysqli_query($con, "SELECT `data` FROM `table` WHERE `name` = '$name';");

```

You can then display your data on your front end by outputting the result.

```php
<?php
    if($row = mysqli_fetch_array($result)) {
        echo $row["data"];
    }
?>

```