ukscotth Posted July 19, 2009 Share Posted July 19, 2009 Hi, Im trying to transfer the data from my old forum to a new one which is different. For some reason when i transfer the posts it misses random posts. This is the code im using, can anyone see a problem with it ? <?php include("include/configvb.inc.php"); $topics = mysql_query("SELECT * FROM joovili_forum_posts WHERE post_board=3"); while ($got_users = mysql_fetch_array($topics)){ $fid = mysql_query("SELECT * FROM joovili_users WHERE username = '".$got_users['post_username']."' LIMIT 1"); if (mysql_num_rows($fid) == 0) { $i ='0'; } else { $fid1 = mysql_fetch_array($fid); $i = $fid1['id']; } $string = $got_users['post_date']; $timestamp = strtotime($string); mysql_query("INSERT INTO post ( `dateline`, `postid`, `threadid`, `username`, `userid`, `pagetext`, `allowsmilie`, `visible` ) VALUES ( '".$timestamp."', '".$got_users['post_id']."', '".$got_users['post_topic']."', '".$got_users['post_username']."', '".$i."', '".$got_users['post_body']."', '1', '1' )"); } ?> many thanks, scott. Link to comment https://forums.phpfreaks.com/topic/166528-transferring-data-from-one-forum-to-another/ Share on other sites More sharing options...
ukscotth Posted July 19, 2009 Author Share Posted July 19, 2009 just had a play about and if i put this in phpmyadmin it manages to transfer all the posts but how do i put variables into this line of code so i can get the userid etc ? INSERT INTO post (postid, threadid, username, userid, pagetext, allowsmilie, visible) SELECT post_id, post_topic,post_username,30,post_body,1,1 FROM joovili_forum_posts Link to comment https://forums.phpfreaks.com/topic/166528-transferring-data-from-one-forum-to-another/#findComment-878219 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.