$sql="SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = ‘数据库名称‘"; $r=$pdo->query($sql,2); foreach($r as $v){ //if($v[‘TABLE_NAME‘]!=‘monxin_index_user‘){continue;} 代码来源 梦行云软件 $sql="alter table `".$v[‘TABLE_NAME‘]."` convert to character set utf8"; if($pdo->exec($sql)){echo $sql.‘<br />‘;} }
原文地址:https://www.cnblogs.com/monxin/p/10479154.html
时间: 2024-10-12 20:59:32