display information from a database column
Posted: Fri Jan 31, 2014 3:25 pm
Hello I made a request to display information from a base against I do not get it to appear in column
For information in the database I have dates with several slots
before(data from the base=
22/10/2013 HD:10h30 HF:11h30
22/10/2013 HD:18h30 HF:20h30
22/10/2013 HD:21h30 HF:22h00
23/10/2013 HD:10h30 HF:11h30
23/10/2013 HD:18h30 HF:20h30
25/10/2013 HD:10h30 HF:11h30
25/10/2013 HD:18h30 HF:20h30
application to display the information in column
22/10/2013---|-23/10/2013--|-23/10/2013--|
D10h30-F11h30|D18h30-F20h30|D18h30-F20h30|
D18h30-F20h30|D10h30-F11h30|
D21h30-F22h00|
Thank you
For information in the database I have dates with several slots
before(data from the base=
22/10/2013 HD:10h30 HF:11h30
22/10/2013 HD:18h30 HF:20h30
22/10/2013 HD:21h30 HF:22h00
23/10/2013 HD:10h30 HF:11h30
23/10/2013 HD:18h30 HF:20h30
25/10/2013 HD:10h30 HF:11h30
25/10/2013 HD:18h30 HF:20h30
application to display the information in column
22/10/2013---|-23/10/2013--|-23/10/2013--|
D10h30-F11h30|D18h30-F20h30|D18h30-F20h30|
D18h30-F20h30|D10h30-F11h30|
D21h30-F22h00|
Thank you
Code: Select all
$date_entre = new DateTime($_POST['date_debut_input']);
$date_entre->modify('-1 day');
echo "<table><tr>";
for ($i = 1; $i <= 4; $i++) {
$date_entre2=$date_entre->modify('+1 day');
echo "<td>".($date_entre2->format('Y-m-j'))."</td>";
$date_heure2[]=$date_entre2->format('Y-m-j');
$deta_heure_unique = array_unique($date_heure2);
};
foreach ($deta_heure_unique as $key ) {
// echo "<td>".$key."</td><td>";
echo "<tr>";
$select1= "SELECT SQL_CALC_FOUND_ROWS t1.*, t3.* FROM agents t1
LEFT join heures t3 on(t1.GAIA = t3.GAIA) where ".$compreq." and date_heures='".$key."' order by date_heures DESC"; //where $compreq $date_entre order by heure_fin
$reponse1 = mysql_query($select1)or die (mysql_error());
while($donne1=mysql_fetch_array($reponse1)){
echo "<td> HD:".$donne1['heure_debut']." HF:".$donne1['heure_fin']."</br>";
}
echo "</td></tr>";
}
echo "</tr></table>";
?>
</div>