PHP通过(PDO)Mysql表字段一键生成创建sqlite的SQL_PHP教程
程序员文章站
2022-03-11 14:24:37
...
首发于:http://www.zzzzy.com/201406053158.html
1 /** 2 * Mysql表字段一键生成创建sqlite的SQL 3 * $db 数据库 4 * $tbname 表名 5 * $is_blob 需要保存的图片二进制数组 array("img1","img2","img3")形式,默认为false 6 * $retbname 自定义生成sqlite的表名 7 * return SQL的语句形式 8 */ 9 10 public function creat_sqlite($db, $tbname, $is_blob = false, $retbname = false){ 11 12 $runsql1 = $db->query("SELECT * FROM `$tbname` limit 1"); 13 $fields_rows = $runsql1->columnCount(); 14 15 $tb_fields_info = array(); 16 $tb_string = ""; 17 $dot = ""; 18 19 for ($i = 0; $i $fields_rows