thinkphp创建临时表
2022-11-24 11:10:29
174
{{single.collect_count}}

thinkphp创建临时表

       /***创建临时表存储设备**/public function createTmptable(){$model = M();$prefix = C('DB_PREFIX');$sql = "CREATE TEMPORARY TABLE ".$prefix."devicetmp(`id` int(10) unsigned NOT NULL AUTO_INCREMENT,`devcode` varchar(64),`address` varchar(255),`location_id` int(10),`type` int(10),`wacode` varchar(64),`kfccode` varchar(64),PRIMARY KEY (`id`)) ";//echo $sql;exit;$model->execute($sql);}

 

查询的时候和其他表一样,唯一的就是每次就要创建一次有点影响性能

$devicetmp = M('devicetmp');$data = $devicetmp->select();
回帖
全部回帖({{commentCount}})
{{item.user.nickname}} {{item.user.group_title}} {{item.friend_time}}
{{item.content}}
{{item.comment_content_show ? '取消' : '回复'}} 删除
回帖
{{reply.user.nickname}} {{reply.user.group_title}} {{reply.friend_time}}
{{reply.content}}
{{reply.comment_content_show ? '取消' : '回复'}} 删除
回帖
收起
没有更多啦~
{{commentLoading ? '加载中...' : '查看更多评论'}}