session_begin(); $auth->acl($user->data); $user->setup(''); $sql = "SELECT * FROM phpbb_rating"; $result = $db->sql_query($sql); while($row = $db->sql_fetchrow($result)) { // okay looping through the old ratings, now obtain topic id and copy. $sql = "SELECT topic_id FROM " . POSTS_TABLE . " WHERE post_id = '" . $row['post_id'] . "'"; $new_result = $db->sql_query($sql); $new_row = $db->sql_fetchrow($new_result); // insert $sql = "INSERT INTO phpbb_topics_evaluation (topic_id, evaluation, user_id) VALUES ('" . $new_row['topic_id'] . "', '" . $row['option_id'] . "', '" . $row['user_id'] . "');"; $db->sql_query($sql); } ?>