| <?php |
| |
| require_once "/home/data/httpd/eclipse-php-classes/system/dbconnection_dashboard_rw.class.php"; |
| require_once "hostname.php"; |
| |
| $db_connection = new DBConnectionDashboard(); |
| $db_handle = $db_connection->connect(); |
| |
| $new_column = array('news_30_answer_average_time', |
| 'news_7_answer_average_time'); |
| |
| $old_column = array('news_30_answer_average_time', |
| 'news_7_answer_average_time'); |
| |
| $data_type = array('int', |
| 'int'); |
| |
| |
| for($i=0;$i<count($old_column);$i++){ |
| $query = "ALTER TABLE ".stats_table()." CHANGE COLUMN ".$old_column[$i]." ".$new_column[$i]." ".$data_type[$i]; |
| echo $query."<br>"; |
| mysql_query($query,$db_handle) or die("Could not alter table: ".mysql_error()); |
| } |
| |
| $db_handle = null; |
| $db_connection = null; |
| ?> |