No output after submit
Posted: Mon Jul 09, 2012 4:07 am
Hallo,
I'm making a dropdown menu with information out of my database. It has to get different brands in my dropdown and when selecting a brand and submit search it will show information about that brand. It gets the brands correct from bij database but after submit nothing happens. Can somebody help me out... Here is my dropdown menu and search (submit) code:
This is my class:
Class:
Maybe a fresh look at it will help
thnx for any help
I'm making a dropdown menu with information out of my database. It has to get different brands in my dropdown and when selecting a brand and submit search it will show information about that brand. It gets the brands correct from bij database but after submit nothing happens. Can somebody help me out... Here is my dropdown menu and search (submit) code:
Code: Select all
<div class="bandwielkolom">
<form action="index.php?lang=nl&p=<?php echo $_GET['p']; ?>#keuze" method="post">
<table class="bandentabel">
<tr>
<th colspan="2">Op merk zoeken<a name="band"></a></th>
</tr>
<tr>
<td>Merk:</td>
<td>
<select name="band_merk">
<option value="0">- Merk -</option>
<?php
$wielen = $wielclass->getMerkenWielen($website);
foreach($wielen as $wiel)
{
echo "\t\t\t\t\t\t\t\t\t\t\t<option value=\"".$wiel->merk_code."\"";
if(isset($_GET['search']) && $_GET['search'] == "band" && isset($_GET['wiel']) && $_GET['wiel'] == $wiel->merk_code || isset($_POST['band_submit']) && $_POST['band_merk'] == $wiel->merk_code) { echo " selected=\"selected\""; }
echo ">".$wiel->merk_naam."</option>\n";
}
?>
</select>
</td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="band_submit" value="Zoek"/></td>
</tr>
</table>
</form>
</div>This is my class:
Class:
Code: Select all
<?php
class wielen extends connect
{
private $wielenlijst;
public function getMerkenWielen($database)
{
$sql = "SELECT * FROM ".$database."_wielen ORDER BY merk_nummer";
try
{
$stmt = $this->db->prepare($sql);
$stmt->execute();
$this->wielenlijst = $stmt->fetchAll(PDO::FETCH_OBJ);
$stmt->closeCursor();
return $this->wielenlijst;
}
catch (Exception $e)
{
die ($e->getMessage());
}
}
public function __construct($dbo)
{
parent::__construct($dbo);
}
}
?>
thnx for any help