Lookup both session userid and database value then using update record
I want only the record with id (myl_bucID) to be updated that has the same user who is logged in.
I do not know how to merge two lookup values.
It works in part if I only use id (see 1 below). But then every post with this id is updated, and with every user. Now I only want this ID to be updated that has the same user who is logged in.
I have two different lookup codes that I want to merge, I think:
1) $UpdateQuery->addFilter("myl_bucID", "=", "d", "".((isset($_POST["buc_id"]))?$_POST["buc_id"]:"") ."");
2) $UpdateQuery->addFilter("myl_bucID", "=", "d", "".$_SESSION['SecurityAssist_UserID'] ."");
Heres the update record code:
<?php
if (isset($_POST["doneRegister"]) || isset($_POST["doneRegister_x"])) {
$UpdateQuery = new WA_MySQLi_Query($bucketListHub);
$UpdateQuery->Action = "update";
$UpdateQuery->Table = "bucMylist";
$UpdateQuery->bindColumn("myl_done", "i", "".((isset($_POST["bucketDone"]))?$_POST["bucketDone"]:"") ."", "WA_DEFAULT");
$UpdateQuery->bindColumn("myl_doneDate", "t", "".((isset($_POST["bucketDoneDate"]))?$_POST["bucketDoneDate"]:"") ."", "WA_DEFAULT");
$UpdateQuery->bindColumn("myl_dateUpdate", "t", "", "WA_CURRENT_TIMESTAMP");
$UpdateQuery->addFilter("myl_bucID", "=", "d", "".((isset($_POST["buc_id"]))?$_POST["buc_id"]:"") ."");
$UpdateQuery->execute();
$UpdateGoTo = "";
if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo?rel2abs($UpdateGoTo,dirname(__FILE__)):"";
$UpdateQuery->redirect($UpdateGoTo);
}
?>