Nu wil ik in de tabel een pull down filter maken op de koppen.
Denk maar aan excel dan de filter functie op de kolommen.
Hoe krijg ik dit voor elkaar?
Alvast bedankt
<section>
<?php
include ("db_config.php");
$output = '';
if(isset($_POST['search'])) {
$searchq = $_POST['search'];
$searchq = preg_replace ("#[^0-9a-z]#i","",$searchq);
$query = mysql_query("SELECT * FROM hoofdartikel WHERE merk LIKE '%$searchq%' OR type LIKE '%$searchq%'") or die ("Kan niet zoeken!");
$count = mysql_num_rows ($query);
if($count == 0){
$output = 'Helaas geen resultaten';
}else{
while($row = mysql_fetch_array($query)) {
$merk = $row['merk'];
$type = $row['type'];
$omschrijving = $row['omschrijving'];
$artnr = $row['artnr'];
$alternatief = $row['alternatief'];
$id = $row['id'];
$output .= '<tr><td>'.$merk.'</td><td>'.$type.'</td><td>'.$omschrijving.'</td><td>'.$artnr.'</td><td>'.$alternatief.'</td></tr>';
}
}
}
?>
</section>
<!doctype html>
<html><head>
<meta charset="utf-8">
<title>zoeken</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div>
<form id="zoekform" action="zoeken.php" method="post">
<input type="text" name="search" placeholder="Zoek naar artikelen.."/>
<input type="submit" value=">>" />
</form></br>
<table id="zoektabel">
<tr>
<th>Artikelnummer</th>
<th>Merk</th>
<th>Type</th>
<th>Omschrijving</th>
<th>Alternatief</th>
</tr>
<?php
print("$output");
?>
</body>
</html>