title: Retrieve and alter the SQL used in a MySQL View for re-execution
body: <p>How can i get the current view criteria using php and the mysql statement "Show create view viewname"</p>
  
  <p>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.</p>
  
  <p>Thanks for any help</p>
  
  <p>--EDIT--</p>
  
  <p>Possible code:</p>
  
  <pre><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();
      }
  }
  </code></pre>