Jump to content

transferring data from one forum to another


ukscotth

Recommended Posts

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.