Created
October 22, 2019 14:04
-
-
Save shabbirbhimani/e3cf531b24ccd4193f6e8d3c3ae5d667 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once(‘./global.php’); | |
$blogs = $db->query_read_slave(“SELECT blogid FROM ” . TABLE_PREFIX . “blog WHERE state = ‘visible'”); | |
while ($blog = $db->fetch_array($blogs)) | |
{ | |
if($blog[‘blogid’]==0) continue; | |
$sql = “INSERT INTO ” . TABLE_PREFIX . “thread (title, forumid, postusername,postuserid,dateline,views) SELECT title, 38, username, userid,dateline,views from “.TABLE_PREFIX.”blog where blogid=$blog[blogid]”; | |
$db->query_write($sql); | |
$insertedthreadid = $db->insert_id(); | |
$sql = “INSERT INTO ” . TABLE_PREFIX . “post (threadid,username, userid, title,dateline, pagetext,ipaddress) select $insertedthreadid, username,userid,title,dateline,pagetext,ipaddress from “.TABLE_PREFIX.”blog_text where blogid=$blog[blogid]”; | |
$insertedpostid = $db->query_write($sql); | |
echo “$blog[blogid],$insertedthreadid\n<br />”; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment