图片数据及文件导入论坛程序全过程
0,将已有图片数据上传到指定目录中
1,从测试网站中导出主题表:hy_thread.sql
2,将hy_thread.sql导入本地mysql数据库,表名:hy_thread
3,从access中将数据表Pic_Main导入本地mysql数据库,表名:Pic_Main
4,将主要数据从Pic_Main表写入到hy_thread表中:
合成图片路径到字段:hy_thread.summary=
--select CONCAT(Pic_Path,Pic_url) from pic_main
--写入:
insert into hy_thread
(fid,uid,pid,title,summary,atime,etime,euid,btime,
buid,views,posts,goods,nos,img,img_count,
top,files,hide,digest,gold,state)
select
"1001","1","0",CONCAT(pic_name,"|",pic_tag),CONCAT(Pic_Path,Pic_url),"1589016214","1589088383","0","1589016214",
"0","0","0","0","0",null,"0",
"0","0","0","0","0","0"
from pic_main
5,更新pid,这个是post表中的与主题对应的ID,因为还没有其他数据,当前可以设置主题id相同。
update hy_thread set pid=tid
6,导出网站表hy_post.sql
7,将hy_post.sql导入本地mysql数据库,表名:hy_post
8,再用表hy_thread生成数据,写入hy_post:
content=<img src='../PicLibrary/201012/20101201_0758_714.jpg' />
--写入数据
insert into hy_post
(tid,fid,uid,rpid,isthread,
content,
atime,etime,euid,goods,nos,posts)
select
tid,fid,uid,"0","1",
CONCAT("<p><img src='../00Pic/",summary,"' /></p>"),
"1589016214","1589088383","0","0","0","0"
from hy_thread
where tid>9
9,将本地表:hy_thread,hy_post,转储为sql文件。
10,在phpMyAdmin中删除原来的表,导入本地转储的文件。
.
--创建PHP随机展示图片文件成功:/Action/00Pic.php
--历时近3小时
23:33 2020\5\15 星期五
【版權聲明】
本文爲原創,遵循CC 4.0 BY-SA版權協議!轉載時請附上原文鏈接及本聲明。
原文鏈接:https://tdlib.com/am.php?t=nNKC83yJNeMJ No Tags