Click to See Complete Forum and Search --> : delete problem in tree list(URGENT)


zuzupus
07-02-2003, 03:16 AM
Hi,

i createdd user list on left frame as tree let say
tree right frame there is form
didi |
vidi |
fifi |
<?
$id += 0;
$r = once_query("SELECT * FROM t_user WHERE sys_pk = $id");
?>
<form action=user.php>
<input name="name" type="text" size="21" value="<?=htmlentities($r->name) ?>" >
<input name="password" type="text" size="21" value="<?=htmlentities($r->password) ?>" >
<input type="button" class="biggray1" value=" Cancel" name="cancel">
</form>
when i clcik on user list tree let say didi on right frame the above form will open with name=didi and pwd=didi
and when i click on this cancel the name didi must remove from tree(user) but when user clciks ont hsi button it always show some alert stating that whether he wants to cancel or not.
in user.php i wrote for insertion but how to use for delete i dont no

$id += 0;
if ($id <= 0) { // creating new user
if ($username && $password) { // check if username and password are set
query_db_trad("INSERT INTO t_user (sys_del, sys_state, sys_dlm, sys_klm, sys_doc, sys_koc, user, password, admin, name, logo_path, logo_width, logo_height, intern, radmin) VALUES ('f', 0, NOW(), 0, NOW(), 0, ".
"'".addslashes($username)."', ".
"'".addslashes($password)."', ".
($admin ? "'t'" : "'f'").", ".
"'".addslashes($name)."', ".
"'".addslashes($logo)."', ".
($width+0).", ".
($height+0).", ".
($intern ? "'t'" : "'f'").", ".
($radmin ? "'t'" : "'f'").
")", 'yes');
}
}


if anybody help me out in this matter i will be very thankful

thanks in advance

zuzupus
07-02-2003, 04:13 AM
i used this code in user.php but still its not working is anybody there to point me out whats the error in this code
if ($delete) {
query_db_trad("DELETE FROM t_user WHERE WHERE sys_pk = $id");
}

//this function is defined liek this
function query_db_trad($arg, $errhandling = 'no') {
global $mysql;
$result = mysql_query($arg, $mysql);
if (!$result) {
if ($errhandling <> 'no') {
if (expire_header()) {
echo "<html >
<head>
";
expire();
echo " <title>Database-Fails</title>
</head>
<body bgcolor=\"#ffffff\">
";
}
echo " <h1>Database-Fails</h1>
SQL-Fails:<br />
Error ".mysql_errno($mysql).": ".htmlentities(mysql_error($mysql))."<br />
</body>
</html>
";
die();
}
}
return $result;
}

thanks