Xataface  2.0alpha2
Xataface Application Framework
 All Data Structures Namespaces Files Functions Variables Groups Pages
clear_views.php
Go to the documentation of this file.
1 <?php
2 error_reporting(E_ALL);
3 ini_set('display_errors','on');
5  function handle(&$params){
6  $res = mysql_query("show tables like 'dataface__view_%'", df_db());
7  $views = array();
8  while ( $row = mysql_fetch_row($res) ){
9  $views[] = $row[0];
10  }
11  if ( $views ) {
12  $sql = "drop view `".implode('`,`', $views)."`";
13  echo $sql;
14  echo "<br/>";
15  $res = mysql_query("drop view `".implode('`,`', $views)."`", df_db());
16  if ( !$res ) throw new Exception(mysql_error(df_db()));
17  }
18  echo "done";
19  }
20 
21 }