filter
als ik op land klik mogen enkel de provincies van dat land zichtbaar zijn
en als ik daarna op provincie klik, mogen enkel de gegevens van deze provincie zichtbaar worden in een tabel.
dit is wat ik nu al heb:
Code (php)
1
2
3
4
5
2
3
4
5
<?php
$sql="SELECT dl . * , p . * , l . * FROM duiklocatie AS dl LEFT JOIN provincies AS p ON ( p.Provincie_Id = dl.Provincies_id ) LEFT JOIN Land AS l ON ( l.Land_id = dl.Land_id )";
$resultaat=mysql_query($sql)or die(mysql_error());
?>
$sql="SELECT dl . * , p . * , l . * FROM duiklocatie AS dl LEFT JOIN provincies AS p ON ( p.Provincie_Id = dl.Provincies_id ) LEFT JOIN Land AS l ON ( l.Land_id = dl.Land_id )";
$resultaat=mysql_query($sql)or die(mysql_error());
?>
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
36
37
38
39
40
41
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
36
37
38
39
40
41
<form action="lijst_duikplaats.php" method="post" id="registreer">
<table>
<tr>
<td>selecteer land:</td>
<td>
<select name="Land">
<?php
$sql2="SELECT * FROM Land ";
$resultaat2=mysql_query($sql2)or die(mysql_error());
while ($rij2 = mysql_fetch_array($resultaat2))
{
echo "<option value=\"";
echo $rij2["Land_Id"]."\">";
echo $rij2["Land"]."</option>\n";
}
?>
</select>
</td>
</tr>
<tr>
<td>selecteer provincie:</td>
<td>
<select name="Provincie">
<?php
$sql3="SELECT * FROM provincies ";
$resultaat3=mysql_query($sql3)or die(mysql_error());
while ($rij3 = mysql_fetch_array($resultaat3))
{
echo "<option value=\"";
echo $rij3["Provincie_Id"]."\">";
echo $rij3["Provincie"]."</option>\n";
}
?>
</select>
</td>
</tr>
<tr>
<td colspan="2"><input name="verzenden" type="submit" value="Toon duikplaatsen" id="Toon_duikplaats_btn" /></td>
</tr>
</table>
</form>
<table>
<tr>
<td>selecteer land:</td>
<td>
<select name="Land">
<?php
$sql2="SELECT * FROM Land ";
$resultaat2=mysql_query($sql2)or die(mysql_error());
while ($rij2 = mysql_fetch_array($resultaat2))
{
echo "<option value=\"";
echo $rij2["Land_Id"]."\">";
echo $rij2["Land"]."</option>\n";
}
?>
</select>
</td>
</tr>
<tr>
<td>selecteer provincie:</td>
<td>
<select name="Provincie">
<?php
$sql3="SELECT * FROM provincies ";
$resultaat3=mysql_query($sql3)or die(mysql_error());
while ($rij3 = mysql_fetch_array($resultaat3))
{
echo "<option value=\"";
echo $rij3["Provincie_Id"]."\">";
echo $rij3["Provincie"]."</option>\n";
}
?>
</select>
</td>
</tr>
<tr>
<td colspan="2"><input name="verzenden" type="submit" value="Toon duikplaatsen" id="Toon_duikplaats_btn" /></td>
</tr>
</table>
</form>
ik vind het schitterend wat je allemaal al hebt maar kun je ook even je datamodel posten? dr loopt hier niemand rond die dat kan raden ben ik bang en als je je datamodel post zijn er genoeg mensen die je binnen 10 min uit de brand zouden kunnen helpen (zeg niet dat het ook echt gebeurt dus pin me dr neit op vast)
duiklocatie
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
CREATE TABLE `duiklocatie` (
`Locatie_Id` tinyint(12) NOT NULL auto_increment,
`Plaatsnaam` varchar(50) character set utf8 collate utf8_unicode_ci NOT NULL,
`Lat` varchar(100) character set utf8 collate utf8_unicode_ci NOT NULL,
`Lng` varchar(100) character set utf8 collate utf8_unicode_ci NOT NULL,
`Straat` varchar(100) character set utf8 collate utf8_unicode_ci NOT NULL,
`Nr` tinyint(4) NOT NULL,
`Postcode` smallint(4) NOT NULL,
`Gemeente` varchar(50) character set utf8 collate utf8_unicode_ci NOT NULL,
`Provincies_id` tinyint(2) NOT NULL,
`Parking` varchar(5) character set utf8 collate utf8_unicode_ci NOT NULL,
`Max diepte` varchar(4) character set utf8 collate utf8_unicode_ci NOT NULL,
`Douche` varchar(4) character set utf8 collate utf8_unicode_ci NOT NULL,
`Prijs` varchar(10) character set utf8 collate utf8_unicode_ci NOT NULL,
`Zuurstof` varchar(4) character set utf8 collate utf8_unicode_ci NOT NULL,
`Kleedkamer` varchar(4) character set utf8 collate utf8_unicode_ci NOT NULL,
`Vulmogelijkheid` varchar(4) character set utf8 collate utf8_unicode_ci NOT NULL,
`Inlichtingen` varchar(100) character set utf8 collate utf8_unicode_ci NOT NULL,
`Tekst` text character set utf8 collate utf8_unicode_ci NOT NULL,
`Land_id` int(11) NOT NULL,
PRIMARY KEY (`Locatie_Id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=32 ;
`Locatie_Id` tinyint(12) NOT NULL auto_increment,
`Plaatsnaam` varchar(50) character set utf8 collate utf8_unicode_ci NOT NULL,
`Lat` varchar(100) character set utf8 collate utf8_unicode_ci NOT NULL,
`Lng` varchar(100) character set utf8 collate utf8_unicode_ci NOT NULL,
`Straat` varchar(100) character set utf8 collate utf8_unicode_ci NOT NULL,
`Nr` tinyint(4) NOT NULL,
`Postcode` smallint(4) NOT NULL,
`Gemeente` varchar(50) character set utf8 collate utf8_unicode_ci NOT NULL,
`Provincies_id` tinyint(2) NOT NULL,
`Parking` varchar(5) character set utf8 collate utf8_unicode_ci NOT NULL,
`Max diepte` varchar(4) character set utf8 collate utf8_unicode_ci NOT NULL,
`Douche` varchar(4) character set utf8 collate utf8_unicode_ci NOT NULL,
`Prijs` varchar(10) character set utf8 collate utf8_unicode_ci NOT NULL,
`Zuurstof` varchar(4) character set utf8 collate utf8_unicode_ci NOT NULL,
`Kleedkamer` varchar(4) character set utf8 collate utf8_unicode_ci NOT NULL,
`Vulmogelijkheid` varchar(4) character set utf8 collate utf8_unicode_ci NOT NULL,
`Inlichtingen` varchar(100) character set utf8 collate utf8_unicode_ci NOT NULL,
`Tekst` text character set utf8 collate utf8_unicode_ci NOT NULL,
`Land_id` int(11) NOT NULL,
PRIMARY KEY (`Locatie_Id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=32 ;
Land:
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
CREATE TABLE `Land` (
`Land_Id` int(11) NOT NULL auto_increment,
`Land` varchar(50) NOT NULL,
PRIMARY KEY (`Land_Id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
--
-- Gegevens worden uitgevoerd voor tabel `Land`
--
INSERT INTO `Land` VALUES(1, 'Belgi');
INSERT INTO `Land` VALUES(2, 'Nederland');
`Land_Id` int(11) NOT NULL auto_increment,
`Land` varchar(50) NOT NULL,
PRIMARY KEY (`Land_Id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
--
-- Gegevens worden uitgevoerd voor tabel `Land`
--
INSERT INTO `Land` VALUES(1, 'Belgi');
INSERT INTO `Land` VALUES(2, 'Nederland');
Provincies:
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
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
CREATE TABLE `provincies` (
`Provincie_Id` tinyint(11) NOT NULL auto_increment,
`Land_id` int(11) NOT NULL,
`Provincie` varchar(50) NOT NULL,
PRIMARY KEY (`Provincie_Id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=24 ;
--
-- Gegevens worden uitgevoerd voor tabel `provincies`
--
INSERT INTO `provincies` VALUES(1, 1, 'West-Vlaanderen');
INSERT INTO `provincies` VALUES(2, 1, 'Oost -Vlaanderen');
INSERT INTO `provincies` VALUES(3, 1, 'Antwerpen');
INSERT INTO `provincies` VALUES(4, 1, 'Limburg');
INSERT INTO `provincies` VALUES(5, 1, 'Vlaams-Brabant');
INSERT INTO `provincies` VALUES(6, 1, 'Waals-Brabant');
INSERT INTO `provincies` VALUES(7, 1, 'Henegouwen');
INSERT INTO `provincies` VALUES(8, 1, 'Luxemburg');
INSERT INTO `provincies` VALUES(9, 1, 'Luik');
INSERT INTO `provincies` VALUES(10, 1, 'Namen');
INSERT INTO `provincies` VALUES(11, 1, 'Brussel');
INSERT INTO `provincies` VALUES(12, 2, 'Groningen');
INSERT INTO `provincies` VALUES(13, 2, 'Friesland');
INSERT INTO `provincies` VALUES(14, 2, 'Drenthe');
INSERT INTO `provincies` VALUES(15, 2, 'Overijssel');
INSERT INTO `provincies` VALUES(16, 2, 'Flevoland');
INSERT INTO `provincies` VALUES(17, 2, 'Gelderland');
INSERT INTO `provincies` VALUES(18, 2, 'Utrecht');
INSERT INTO `provincies` VALUES(19, 2, 'Noord-Holland');
INSERT INTO `provincies` VALUES(20, 2, 'Zuid-Holland');
INSERT INTO `provincies` VALUES(21, 2, 'Zeeland');
INSERT INTO `provincies` VALUES(22, 2, 'Noord-Brabant');
INSERT INTO `provincies` VALUES(23, 2, 'Limburg');
`Provincie_Id` tinyint(11) NOT NULL auto_increment,
`Land_id` int(11) NOT NULL,
`Provincie` varchar(50) NOT NULL,
PRIMARY KEY (`Provincie_Id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=24 ;
--
-- Gegevens worden uitgevoerd voor tabel `provincies`
--
INSERT INTO `provincies` VALUES(1, 1, 'West-Vlaanderen');
INSERT INTO `provincies` VALUES(2, 1, 'Oost -Vlaanderen');
INSERT INTO `provincies` VALUES(3, 1, 'Antwerpen');
INSERT INTO `provincies` VALUES(4, 1, 'Limburg');
INSERT INTO `provincies` VALUES(5, 1, 'Vlaams-Brabant');
INSERT INTO `provincies` VALUES(6, 1, 'Waals-Brabant');
INSERT INTO `provincies` VALUES(7, 1, 'Henegouwen');
INSERT INTO `provincies` VALUES(8, 1, 'Luxemburg');
INSERT INTO `provincies` VALUES(9, 1, 'Luik');
INSERT INTO `provincies` VALUES(10, 1, 'Namen');
INSERT INTO `provincies` VALUES(11, 1, 'Brussel');
INSERT INTO `provincies` VALUES(12, 2, 'Groningen');
INSERT INTO `provincies` VALUES(13, 2, 'Friesland');
INSERT INTO `provincies` VALUES(14, 2, 'Drenthe');
INSERT INTO `provincies` VALUES(15, 2, 'Overijssel');
INSERT INTO `provincies` VALUES(16, 2, 'Flevoland');
INSERT INTO `provincies` VALUES(17, 2, 'Gelderland');
INSERT INTO `provincies` VALUES(18, 2, 'Utrecht');
INSERT INTO `provincies` VALUES(19, 2, 'Noord-Holland');
INSERT INTO `provincies` VALUES(20, 2, 'Zuid-Holland');
INSERT INTO `provincies` VALUES(21, 2, 'Zeeland');
INSERT INTO `provincies` VALUES(22, 2, 'Noord-Brabant');
INSERT INTO `provincies` VALUES(23, 2, 'Limburg');
weet soms iemand iets?
je kunt ook een chain select gebruiken zonder database en vervolgens de results toevoegen aan een database
Niet bumpen