<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
include_once 'includes/config.php';
$con = mysql_connect($HOST,$USER,$PASSWORD);
                   if(!$con) { echo "Cannot connect to the database ";die();}
                   mysql_select_db(MYSQL_DB);
                   $result=mysql_query('show tables');
                   while($tables = mysql_fetch_array($result)) {

                            foreach ($tables as $key => $value) {
                            //  /php/i   /goStores_Vista_/i

                                mysql_query("ALTER TABLE $value CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci");
                                
                                /*if (preg_match("/goStores_Vista_/i", $value, $match)) {
                                    echo $value. '<br>';
                                    mysql_query("ALTER TABLE $value CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci");
                                } else {
                                	echo 'no match for '.$value. '<br>';
                                }*/

                       }}
                   echo "The collation of your database has been successfully changed!";
?>

