我有一个需要用 id 列表更新的视图。因此,我将已选择从视图中删除的值存储在会话变量中,然后进入 mySQL 查询,如下所示。然后,当表单被重置时,值也会从数组中重置。
但它不起作用......这就是我所拥有的。
任何帮助,将不胜感激。
if($_POST['flag']=='flag'){
//collect deleted rows
$_SESSION['delete-row'][] = $_POST['idval'];
//Split session array
$idavls = join(',' , $_session['delete-row'];
$sqlDelete = "CREATE OR REPLACE VIEW filtetbl AS SELECT * FROM `".$page['db-name']."`.`leads_tbl` WHERE ".$_SESSION['filter-view']." AND `lead_status` = '1' AND `lead_id` NOT IN (".$idvals.") ORDER BY `lead_added`";
$result = mysql_query($sqlDelete);
if($result){
echo true;
}
else{
echo mysql_error();
}
}