0

I want to delete top first row from table in firebase Database when no. of rows reach to 50. I can search this lot of time but still not found. Anyone tell that how I can do this.

1 Answers1

0

Through this technique

$searchdata = "Data";
    $fetchdata = $database->getReference($searchdata)->getValue();
    $found = 0;
    $array=0;
        if($fetchdata > 0)
        {
            foreach($fetchdata as $Key => $row)
            {
                if($found == 0)
                {
                    $del = "Data/".$Key;
                    $DelRef = $database->getReference($del)->remove();
                    $found=1;
                }
                else
                {
                    break;
                }
            }
        }