Wiatm
Mam bazę danych SQL. Jak zrobić aby w drugiej liście wyboru były wyświetlane dane w zależności od pierwszej listy wyboru?
function selectDistinct2 ($connection)
{
$distinctQuery2 = "SELECT DISTINCT ocena FROM ocena";
$resultId2 = @ mysql_query ($distinctQuery2, $connection);
$i2 = 0;
while ($row2 = @ mysql_fetch_array($resultId2))
$resultBuffer2[$i2++] = $row2[ocena];
echo "\n<select name=\"a2\">";
foreach ($resultBuffer2 as $result2)
echo "\n\t<option>$result2";
echo "\n</select>";
}
echo "\n Ocena: ";
selectDistinct2($connection, "a2");
function selectDistinct4 ($connection)
{
$distinctQuery4 = "SELECT DISTINCT opis_oceny FROM specyfikacja";
$resultId4 = @ mysql_query ($distinctQuery4, $connection);
$i4 = 0;
while ($row4 = @ mysql_fetch_array($resultId4))
$resultBuffer4[$i4++] = $row4[opis_oceny];
echo "\n<select name=\"a4\">";
foreach ($resultBuffer4 as $result4)
echo "\n\t<option>$result4";
echo "\n</select>";
}
echo "\n Za co: ";
selectDistinct4($connection, "a4");
Pomóżcie. Jak to zrobić?