How can i get the current view criteria using php and the mysql statement “Show create view viewname”
I want to put the current criteria into a variable, amend that variable and then re-run the query. I just don’t get how to use the statement from PHP.
Thanks for any help
–EDIT–
Possible code:
if($_POST['flag']=='flag'){
$sqlShow = 'show create view `filter_tbl`';
$result = mysql_query($sqlShow);
$resultQuery = $result;
$resultQuery .= ' AND `lead_id`!="'.$idval.'"';
$result2 = mysql_query($resultQuery);
echo $result;
if($result){
echo true;
}
else{
echo mysql_error();
}
}
Use this to get the SQL statement that the View uses:
Note I don’t know what the actual WHERE clause of your View is, so the str_ireplace() above is just an example of how you might make your alteration.