Przygode z php i SQL zaczalem dopiero tydzine temu, wiec prosze o wyrozumialosc.
Troche opisze sytuacje: Mam tabele w MySQL zwana 'Hirer' która zawiera informacje takie jak adres zamieszkania, telefon, email itd.
Kazdy wiersz w tej tabeli jest identyfikowany przez pole 'HirerID' które jest auto_increment primary key.
Teraz, zrobilem w php skrypt który wyswietla na stronie wszystkich Hirer'ów w tej tabeli. Jednak chce zeby na koncu kazdego wiersza miec link który skasuje z tej tabeli dany wiersz, jednak link ten nie dziala.
Bylbym wdzieczny gdyby ktos mógl podac gdzie mam blad i jak powinna ta strona wygladac by poprawnie dzialala:
<html> <head> </head> <body> <?php if (!$dbcnx) { } } //removing deleted hirers if set $HirerID = $row['HirerID']; $sql = "DELETE FROM Hirer WHERE HirerID=$HirerID"; } else { } } ?> <!-- show Hirers currently in the database --> Here are all the hirers currently in the database:</p> <?php $result = @mysql_query('select HirerID, Title, Surname, Forename, Street_Number, Town_City, County, Post
Code, Home_Tel, Mobile_Tel, Email from Hirer'); if (!$result) { } ?> <table width="85%" valign="center"><tr><td width="10"> <?php <!-- set to delete Hirer on click --> '?deletehirer=' . $HirerID . '">' . 'Remove Hirer</a>'; ?> </td> </table> <?php } ?> </body> </html>
Dziekuje i pozdrawiam,
eXido