mardi 28 juin 2016

Spacing between results PHP Mysql


i have the below code.

im completely new to PHP and mysql

<table align="center" border="0" width="100%">
<tr>
<th>id</th>
    <th>Staff Name</th>
    <th>Date</th>
    <th>Reason</th>
</tr>

<?php

    $startdate = $_SESSION['startdate'];
    $enddate = $_SESSION['enddate'];

    $code = mysql_query("SELECT id, name, UNIX_TIMESTAMP(date) AS date, reason FROM taken WHERE date BETWEEN '$startdate' AND '$enddate' ORDER BY date ASC");


    while($row = mysql_fetch_array($code)) {



 echo "t<tr><td>{$row['id']} ".
"</td><td>{$row['name']}  ".
"</td><td>" . date( "d/m/Y", $row['date'] ) ."".
     "</td><td>{$row['reason']} </td></tr>n";

it produces the below result but i want to put a space between the date change. I.E a space / break between 28/05/2016 & 29/05/26.

Any help would be appreciated.

id  Staff Name  Date    Reason
1296    28/05/2016  Holiday
1832    28/05/2016  Holiday
1330    28/05/2016  Holiday
825 28/05/2016  Holiday
1858    28/05/2016  Holiday
849 28/05/2016  Holiday
1958    28/05/2016  Holiday
2022    28/05/2016  Holiday
1263    28/05/2016  Holiday
1331    29/05/2016  Holiday
826 29/05/2016  Holiday
1959    29/05/2016  Holiday
2023    29/05/2016  Holiday
1264    29/05/2016  Holiday
1332    30/05/2016  Holiday
827 30/05/2016  Holiday
1960    30/05/2016  Holiday
2024    30/05/2016  Holiday
1265    30/05/2016  Holiday
533 31/05/2016  Holiday
1843    31/05/2016  Holiday
52  31/05/2016  Holiday
1420    31/05/2016  Holiday
1679    31/05/2016  Holiday
1938    31/05/2016  Holiday
936 31/05/2016  Holiday
231 31/05/2016  Holiday

Aucun commentaire:

Enregistrer un commentaire