I have a problem. My code looks like this:
<?
$name = $HTTP_POST_VARS["name"];
if (!$name) {
echo "Sökfältet var tomt!";
exit;
}
$db = mysql_connect("localhost");
mysql_select_db("musik", $db);
$query = "select grupp from grupper where grupp like '%".$name."%'";
$result = mysql_query($query);
if (mysql_num_rows($result) == 0) {
echo "sorry, no matching results.";
echo $link;
exit;
}
while ($record = mysql_fetch_assoc($result)) {
while (list($fieldname, $fieldvalue) = each ($record)) {
echo "<b>".$fieldvalue."</b><BR>";
}
echo "<BR>";
}
echo $link;
?>
This works fine but I would like to select gruppID from grupper and use the number to create a list based on another table called album. Does anyone understand what I mean?
It´s quite simple... on one table i have a bunch of groups and all of them have a different id (gruppID). On the other table i have a bunch of albums. the albums have an id(gruppID) based on what group it belongs to.:rolleyes: