migrate comments

1306458000'); db_set_active(); while ($row=db_fetch_object($result)) { print 'Title is '.$row->title.'
'; $result2 = db_query("select nid from node where title='%s'",$row->title); while ($row2=db_fetch_object($result2)) { print $row2->nid; print '
'; $edit = array('pid'=>$row->pid,'nid'=>$row2->nid,'uid'=>$row->uid,'subject'=>$row->subject,'comment'=>$row->comment,'hostname'=>$row->hostname,'timestamp'=>$row->timestamp,'status'=>$row->status,'format'=>$row->format,'thread'=>$row->thread,'name'=>$row->name,'mail'=>$row->mail,'homepage'=>$row->homepage,'ip_address'=>$row->ip_address); if ($edit['comment'] == '2') print 'WTF?!?'; else db_query("INSERT INTO {comments} (nid, pid, uid, subject, comment, format, hostname, timestamp, status, thread, name, mail, homepage) VALUES (%d, %d, %d, '%s', '%s', %d, '%s', %d, %d, '%s', '%s', '%s', '%s')", $edit['nid'], $edit['pid'], $edit['uid'], $edit['subject'], $edit['comment'], $edit['format'], $edit['hostname'], $edit['timestamp'], $edit['status'], $edit['thread'], $edit['name'], $edit['mail'], $edit['homepage']); } } ?>