tsilver10 Posted August 11, 2008 Share Posted August 11, 2008 I have a phpBB database which I am trying to convert to work with Joomla. I'm using a script someone has provided and it works fine...apart from one section - the message text. It doesn't give me an error or anything so I can only assume it is timing out. What I would like to do is split the query/migration of the message text into blocks. Here is the what is doing at the moment: //Populate Messages_Text Table echo "<br />Populating Messages_Text Table...\n"; $query="TRUNCATE TABLE `$joomla_db`.`{$joomla_dbprefix}fb_messages_text`"; $result = mysql_query($query) or die("<br />Invalid query:<br />$query<br />" . mysql_error()); $query="SELECT post_id, post_text FROM `$phpbb_db`.`{$phpbb_dbprefix}posts`"; $result = mysql_query($query) or die("<br />Invalid query:<br />$query<br />" . mysql_error()); $mtext = array(); $mpostid = array(); while ($row = mysql_fetch_object($result)) { $text = addslashes($row->post_text); $mtext[] = prep($text); $mpostid[] = $row->post_id; } mysql_free_result($result); for ($i=0; $i < count($mtext); $i++){ $query="INSERT INTO `$joomla_db`.`{$joomla_dbprefix}fb_messages_text`" ." (mesid, message) VALUES" ." (".$mpostid[$i].", \"".$mtext[$i]."\")"; $result = mysql_query($query) or die("<br />Invalid query:<br />$query<br />" . mysql_error()); } echo "OK\n"; Does anyone have any tips for me to split this up? Quote Link to comment Share on other sites More sharing options...
fenway Posted August 11, 2008 Share Posted August 11, 2008 Why not directly INSERT INTO... SELECT WHRERE? Quote Link to comment Share on other sites More sharing options...
tsilver10 Posted August 12, 2008 Author Share Posted August 12, 2008 Why not directly INSERT INTO... SELECT WHRERE? Yep have fixed it now thanks. Just used ALTER TABLE and then added parts of it one at a time. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.