Line Break

Dear Experts

The data in table is like this

tt

and I have this command to display data

if ($button == "btn_Get"){
    $query2 = "select * from sales";
    $result = mysqli_query($dbc, $query2);
    $rows_count = mysqli_num_rows($result);
    if ($rows_count > 0)
    
    while ($row=mysqli_fetch_array($result)){
        echo $row['ddate'];
        echo "";
        echo $row['d_ltr'];
        echo "";
        echo $row['d_rat'];
        echo "";
        echo $row['d_amt'];
        echo "";
        echo "||";
        }
        
    else
    {
     echo "ERROR: Could not able to execute" . $query . " " . mysqli_error($dbc);}
}

and the result looks like this

t2

But I want to display data in this format

2023-05-09
56.00
140.82
7886.00

2023-05-09
454.00
12.45
5654.00

I mean every column in new row.

How it will be possible?

Please

echo $row['ddate'] . "<br>"; // New Line

or

echo "<p>" . $row['ddate'] . "</p>";

1 Like
Sponsor our Newsletter | Privacy Policy | Terms of Service