<?php

include('functions.php');
include('db.inc.php');

$mydb = new db();
$stmt="SELECT ids FROM kk_lista WHERE id='$list_id'";
$result=$mydb->query($stmt);

$row = mysql_fetch_object($result);

$a_ids = unserialize(base64_decode($row->ids));
$i_remove = array_keys($a_ids, $id);
unset($a_ids[$i_remove[0]]);
$a_new = array_values($a_ids);

$s_base64 = base64_encode(serialize($a_new));

$stmt = "UPDATE kk_lista SET ids='" .$s_base64. "' WHERE id=".$list_id;
$result=$mydb->query($stmt);

header("Location:a_lista_edit.php?id=$list_id");

?>