Napisałem skrypt który wyciąga dane z tabeli i wszystko dobrze działa. Błąd polega na tym że chciałbym wyświetlac odpowiednie dane a nie wszystkie jednocześnie. Do tej pory po wpisaniu jakiegokolwiek słowa wyświetlane są wszystkie dane jakie znajdują się w tabeli. Chcę napisać taki skryp który po wpisaniu np. imienia Marek wyświetli tylko osoby o tym imieniu.
Skryp wygląda nastepująco:
<?php
$db_name = \"praca\";
$con = mysql_connect(\"localhost\") or die(\"Blad otwarcia bazy\"); $sql = \"select * from Studenci\";
print \"<table border=1>\";print \"<tr><td><b>ID</b></td><td><b>Imie</b></td><td><b>Nazwisko</b></td><td><b>Nr indeksu</b></td><td><b>Rok studiów</b></td><td><b>Email</b></td><td><b>Edycja</b></td><td><b>Usuń</b></td></tr>\"; while ($record = mysql_fetch_array($result)){$ID_studenta = $record[0
];$Imie = $record[2
];$Nazwisko = $record[3
];$Nr_indeksu = $record[4
];$Rok_studiow = $record[5
];$Email = $record[6
]; print \"<tr><td>$ID_studenta</td><td>$Imie</td><td>$Nazwisko</td><td>$Nr_indeksu</td><td>$Rok_studiow</td><td>$Email</td><td><a href=\"modyfikuj_studenta.php?stan=modyf&ID_studentamodyf= $record[0]\\">Edytuj</a></td><td><a href=\"wy_studentow.php?stan=del&ID_studentadel= $record[0]\">Usuń</a></td>\"; #print \"</table>\";
#echo \"<form>
#<input type='text' name='ID_studenta' size='10' value='\",$record['0'],\"'>
#<input type='text' name='Imie' size='10' value='\",$record['2'],\"'>
#<input type='text' name='Nazwisko' size='10' value='\",$record['3'],\"'>
#<input type='text' name='Nr_indeksu' size='15' value='\",$record['4'],\"'>
#<input type='text'name='Rok_studiow' size='15' value='\",$record['5'],\"'>
#<input type='text' name='Email' size='15' value='\",$record['6'],\"'>
#echo \"></form>\";
#echo \"<br/>\";
}
print \"</center>\"; if($stan=='del') {
$zapytanie2=\"DELETE FROM Studenci WHERE ID_studenta=$ID_studentadel\";
echo \"Rekord o id=$ID_studentadel został skasowany !\"; }
else {
}
?>
jeżeli znaleźliście błąd to napiszcie w którym miejscu.