datum activiteit maar 1 maar weergeven
Het resultaat is nu :
2015-02-22
09:30:00 U17P Ploeg1 - ploeg2
2015-02-22
15:00:00 Elite Ploeg4 - Ploeg3
2015-02-25
19:30:00 U17BB Ploeg1 - Ploeg3
2015-02-27
20:00:00 U21 Ploeg4 - Ploeg5
en ik zou het graag zo hebben :
2015-02-22
09:30:00 U17P Ploeg1 - ploeg2
15:00:00 Elite Ploeg4 - Ploeg3
<br>
2015-02-25
19:30:00 U17BB Ploeg1 - Ploeg3
<br>
2015-02-27
20:00:00 U21 Ploeg4 - Ploeg5
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
$sql="SELECT *
FROM
activiteit
WHERE
DATE_ADD( datum, INTERVAL( YEAR( CURDATE( ) ) - YEAR( datum ) ) YEAR )
BETWEEN NOW( ) AND DATE_ADD( NOW( ) , INTERVAL 7 DAY )
order by datum, uur";
if ($result=mysqli_query($conn,$sql))
{
// Fetch one and one row
while ($row=mysqli_fetch_row($result))
{
echo" <table border='1' width='630'><tr><td colspan='5'>$row[0]</td></tr>";
echo " <tr><td width='60'>$row[1]</td>";
echo " <td width='60'>$row[2]</td>";
echo " <td width='250'>$row[3]</td>";
echo " <td width='10'>-</td>";
echo " <td width='250'>$row[4]</td></tr></table>";
}
// Free result set
mysqli_free_result($result);
}
//Close connection
mysqli_close($conn);
?>
$sql="SELECT *
FROM
activiteit
WHERE
DATE_ADD( datum, INTERVAL( YEAR( CURDATE( ) ) - YEAR( datum ) ) YEAR )
BETWEEN NOW( ) AND DATE_ADD( NOW( ) , INTERVAL 7 DAY )
order by datum, uur";
if ($result=mysqli_query($conn,$sql))
{
// Fetch one and one row
while ($row=mysqli_fetch_row($result))
{
echo" <table border='1' width='630'><tr><td colspan='5'>$row[0]</td></tr>";
echo " <tr><td width='60'>$row[1]</td>";
echo " <td width='60'>$row[2]</td>";
echo " <td width='250'>$row[3]</td>";
echo " <td width='10'>-</td>";
echo " <td width='250'>$row[4]</td></tr></table>";
}
// Free result set
mysqli_free_result($result);
}
//Close connection
mysqli_close($conn);
?>
Gewijzigd op 20/02/2015 17:32:54 door Koshi koshi
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
$sql="SELECT *
FROM
activiteit
WHERE
DATE_ADD( datum, INTERVAL( YEAR( CURDATE( ) ) - YEAR( datum ) ) YEAR )
BETWEEN NOW( ) AND DATE_ADD( NOW( ) , INTERVAL 7 DAY )
order by datum, uur";
if ($result=mysqli_query($conn,$sql))
{
// initieer de datum
$savedatum = "";
// Fetch one and one row
while ($row=mysqli_fetch_row($result))
{
echo" <table border='1' width='630'>";
if ($row[0] != $savedatum) {
echo" <table border='1' width='630'><tr><td colspan='5'>$row[0]</td></tr>";
$savedatum = $row[0];
}
echo " <tr><td width='60'>$row[1]</td>";
echo " <td width='60'>$row[2]</td>";
echo " <td width='250'>$row[3]</td>";
echo " <td width='10'>-</td>";
echo " <td width='250'>$row[4]</td></tr></table>";
}
// Free result set
mysqli_free_result($result);
}
//Close connection
mysqli_close($conn);
?>
$sql="SELECT *
FROM
activiteit
WHERE
DATE_ADD( datum, INTERVAL( YEAR( CURDATE( ) ) - YEAR( datum ) ) YEAR )
BETWEEN NOW( ) AND DATE_ADD( NOW( ) , INTERVAL 7 DAY )
order by datum, uur";
if ($result=mysqli_query($conn,$sql))
{
// initieer de datum
$savedatum = "";
// Fetch one and one row
while ($row=mysqli_fetch_row($result))
{
echo" <table border='1' width='630'>";
if ($row[0] != $savedatum) {
echo" <table border='1' width='630'><tr><td colspan='5'>$row[0]</td></tr>";
$savedatum = $row[0];
}
echo " <tr><td width='60'>$row[1]</td>";
echo " <td width='60'>$row[2]</td>";
echo " <td width='250'>$row[3]</td>";
echo " <td width='10'>-</td>";
echo " <td width='250'>$row[4]</td></tr></table>";
}
// Free result set
mysqli_free_result($result);
}
//Close connection
mysqli_close($conn);
?>
Gewijzigd op 20/02/2015 18:25:44 door Jan de Laet
dagnaam in het nederlands dag/maand/jaar
Daarnaast zul je moeten checken of je setlocale goed staat, bijv: setlocale (LC_ALL, 'nl_NL');