Witam mam taki problem
Chciałbym usunąć cały rekord z mojej tabeli - mam tabele składającą się z 3 pól a obok nich 2 linki - jeden do usuwania rekordu a drugi do edycji - jednak po nacisnięciu na USUN skrypt przenosi mnie do stronyej głównej. Próbowałem aby link sie odnosił do tej strony na której jest tabela, ale nie działa. Chodzi mi o to aby po naciśnięciu na usuń cały rekord był usunięty i żeby zaraz taka tabela się pojawiła.
Oto mój skrypt w którym gdzieś są jakieś błędy:
baza_admin.php
<?php
// informacje na temat bazy
$host = 'tu cos jest';
$user = 'user';
$password = 'hasło';
$dbName = 'nazwa bazy';
// polaczenie i wybór bazy danych
$pole_id='id';
$pole_nazwa='nazwa';
$pole_cena='cena';
echo "<table width='1000' align='center' border='0' cellspacing='0'>"; echo "<td width='200' align='center'>".$pole_id."</td>"; echo "<td width='200' align='center'>".$pole_nazwa."</td>"; echo "<td width='200' align='center'>".$pole_cena."</td>"; echo "<td width='200' align='center'>"."</td>"; echo "<td width='200' align='center'>". "</td>";
{
echo "<table width='1000' align='center' border='2' cellspacing='2'>"; echo "<td width='200' align='center'>".$pola['id']."</td>"; echo "<td width='200' align='center'>".$pola['nazwa']."</td>"; echo "<td width='200' align='center'>".$pola['cena']."</td>"; echo "<td width='200' align='center'> <a href=\"index.php?a=del&id={$pola['id']}\">USUŃ</a></td>";
echo "<td width='200' align='center'> <a href=\"index.php?a=edit&id={$pola['id']}\">EDYTUJ</a></td>";
}
if($a == 'del' and
!empty($id)) {
/* usuwamy rekord */
echo 'Rekord został usunęty z bazy'; }
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
</body>
</html>
Z góry Dziękuję za pomoc
Ten post edytował gallardo83 20.11.2007, 15:50:00