Show data from the mysql database on a php / html page

0

I have a problem while displaying data from a database table on the screen.

  • I was able to show the data but I can not skip the line, show the data sequentially, code below.
  •     

        $sql = $connection->query("Select * from  usuarios");
                if($sql)
               {
                    while($exibe = $sql->fetch_assoc())
                        {
                            foreach($exibe as $key => $value)
                                {
                                    echo "<td>". $value."</td>";
                                }
                        }
                }
    

        
    asked by anonymous 13.09.2018 / 21:17

    1 answer

    1

    Try the following:

    $sql = $connection->query("Select * from  usuarios");
            if($sql)
           {
                while($exibe = $sql->fetch_assoc())
                    {
                        echo "<tr>"
                        foreach($exibe as $key => $value)
                            {
                                echo "<td>". $value."</td>";
                            }
                         echo "</tr>"
                    }
            }
    
        
    13.09.2018 / 21:24