Is there a problem with the error in running the program?

<?php

class read
{
    private $data;

    function __construct()
    {
        if ($db = new DataBase()) {
            $this->data = $db->showData();
        }
    }

    function __toString()
    {
        $out = "";
        while ($this->data) {
            $out .= "<tr>";
            $out .= "</td>"".$this->data["id"].""</td>";
            $out .= "</td>"".$this->data["title"].""</td>";
            $out .= "</td>"".$this->data["u_id"].""</td>";
            $out .= "</td>"".$this->data["content"].""</td>";
            $out .= "</td>"".$this->data["time"].""</td>";
            $out .= "</tr>";
        }
        $out .= "</table></div>";
        return $out;
    }
}
Is there something wrong with this code? Running always goes wrong.

Php
Mar.12,2021

 function __toString()
{
    $out = '';
    $out .= '<tr>';
    foreach($this->data as $v)
    {
        $out .= "</td>'".$v."'</td>";
    }
    $out .= '</tr>';
    $out .= '</table></div>';
    return $out;
}

while($row=mysql_fetch_row){
   //do something
}

this does not cause an endless loop because the mysql_fetch_row function automatically modifies the index value.

in addition, the code of the landlord does not need to use a loop at all.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b35b24-2bfbc.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b35b24-2bfbc.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?