<?php
    //open connection to mysql db
    $connection = mysqli_connect("","","","") or die("Error " . mysqli_error($connection));

    //fetch table rows from mysql db
    $sql = "select id, plant_name, picture from Plants";
    $result = mysqli_query($connection, $sql) or die("Error in Selecting " . mysqli_error($connection));

    //create an array
    $emparray = array();
    while($row =mysqli_fetch_assoc($result))
    {
        $emparray[] = $row;
    }
    echo json_encode($emparray);

    //close the db connection
    mysqli_close($connection);
?>