Hey Guys,
I'm an a complete noob if it comes to programming. For my own store I am programming my own productcatalog because i don't like to work with Wordpress... To get data from my database I used this code (just a snipped, i opened a connection in the previous code from the document) :
<?php
$resultSet = $conn->query("SELECT ID, naam, groepID FROM subgroep INNER JOIN groep ON subgroep.groepID=groep.ID");
if($resultSet->num_rows != 0){
while($rows = $resultSet->fetch_assoc()){
$subgroep = $rows['naam'];
echo "<option value='$subgroep'>$subgroep</option>";
}
}else{
echo "No results";
}
?>
The databases I use are named: 'groep' (ID, naam, afbeelding) and 'subgroep' (ID, naam, groepID, afbeelding). So I geuss it's quite a stupid mistake I made. But can someone please explane to me how it's done properly?
Grtz, Saskia