Code:
<body bgcolor="#FFFFFF" text="#000000">
<table width=680 border=1>
<tr>
<th>Ime</th>
<th>Email</th>
<th>izbrishi</th>
</tr>
<?
extract($_GET); //u slucaju da je register_globals ishkljucen
$connection = mysql_connect("localhost", "logname", "pwd");
$db = mysql_select_db("adresar", $connection);
if ($izbrishi) {
$sql2 = "DELETE FROM adresar WHERE id='$izbrishi'";
mysql_query($sql2);
}
$sql = mysql_query("SELECT * FROM adresar");
$ima = mysql_num_rows($sql);
if ($ima <>0){
while ($row = mysql_fetch_array($sql)) {
$id = $row["id"];
$ime=$row["name"];
$adresa=$row["email"];
echo "<tr>
<td>$ime</td>
<td>$adresa</td>
<td><a href='?izbrishi=$id'>Izbrishi</a></td>
</tr>";
}
}
else echo "U bazi nema ovakvog zapisa!";
?>
</table>
</body>
</html>
Ovaj code nisam proverio (nadam se da sve radi kako treba ali....) u slucaju da neshto ne radi pitaj opet i josh neshto!!!!
Kako ti se zove tabela? addressbook ili adresar????