2 //requiring main config file with path/database etc. constants
3 require('../config/config.inc');
5 //connecting to database and creating universal $db object
6 require(SYSTEM_ROOT
.'/inc/log.inc');
7 require(SYSTEM_ROOT
.'/inc/database.inc');
8 require(SYSTEM_ROOT
.'/inc/nodes.inc');
9 $db=new CLASS_DATABASE();
10 $db->query("set autocommit=0");
12 $db_old=new CLASS_DATABASE("kyberia","kyberia","cyb3ry","127.0.0.1");
14 $q="select * from nodes where node_type='7'";
15 $userset=$db->query($q);
16 while ($userset->next()) {
17 $users[$userset->getString('old_id')]=$userset->getString('node_id');
20 $friendset=$db_old->query("select * from friends");
21 while ($friendset->next()) {
22 $q="insert into nodes set node_type='8',node_name='friend::".$users[$friendset->getString('friend_id')]."::".$users[$friendset->getString('user_id')]."::".rand(1,23000)."',node_parent='".$users[$friendset->getString('friend_id')]."',node_creator='".$users[$friendset->getString('user_id')]."'";
25 $q="insert into node_content set node_id=LAST_INSERT_ID(),node_content='".$friendset->getString('friend_text')."'";
This page took 0.274336 seconds and 4 git commands to generate.