![]() |
Xataface 2.0
Xataface Application Framework
|
00001 <?php 00002 error_reporting(E_ALL); 00003 ini_set('display_errors','on'); 00004 class dataface_actions_clear_views { 00005 function handle(&$params){ 00006 $res = mysql_query("show tables like 'dataface__view_%'", df_db()); 00007 $views = array(); 00008 while ( $row = mysql_fetch_row($res) ){ 00009 $views[] = $row[0]; 00010 } 00011 if ( $views ) { 00012 $sql = "drop view `".implode('`,`', $views)."`"; 00013 echo $sql; 00014 echo "<br/>"; 00015 $res = mysql_query("drop view `".implode('`,`', $views)."`", df_db()); 00016 if ( !$res ) throw new Exception(mysql_error(df_db())); 00017 } 00018 echo "done"; 00019 } 00020 00021 }