本帖最后由 wangxing128 于 2010-8-13 00:32 编辑
网上发的运气农场转qfarm工具
看代码是给pw(pubwind)准备的
从表名的前缀可以看出 而数据库是通用的
我现在要给discuz用
如下进行更改
<?php
# 数据库升级
include_once('common.php');
header('Content-Type:text/html; charset=utf-8');
header('Cache-Control: no-cache, must-revalidate');
//uid, money, YB, pf, m_exp, n_exp, reclaim, num
//用户id,金币,元宝,开通牧场,牧场经验,农场经验,农田数,红田数
$list = $_QFG['db']->fetchAll("
SELECT c.uid, c.money, c.YB, c.pf, m.exp as m_exp, n.exp as n_exp, n.reclaim, r.num FROM(
((pw_11rpfarm_config c
LEFT JOIN pw_11rpfarm_mc m ON m.uid=c.uid)
LEFT JOIN pw_11rpfarm_nc m ON n.uid=c.uid)
LEFT JOIN pw_11rpfarm_record r ON r.uid=c.uid
)
");
$count = count($list);
foreach($list as $v) {
$_QFG['db']->query("INSERT INTO app_qqfarm_user(uid,money,YB,pf) VALUES($v['uid'],$v['money'],$v['YB'],$v['pf'])");
if($v['pf']) {
$_QFG['db']->query("INSERT INTO app_qqfarm_mc(uid,exp) VALUES($v['uid'],$v['m_exp'])");
}
$_QFG['db']->query("INSERT INTO app_qqfarm_nc(uid,exp,reclaim) VALUES($v['uid'],$v['n_exp'],$v['reclaim'])");
}
die('OK. 转化成功 QFarm 4.6');
?>
跟据我的数据库(两个窗口合在一起截图)
改为
<?php
# 数据库升级
include_once('common.php');
header('Content-Type:text/html; charset=utf-8');
header('Cache-Control: no-cache, must-revalidate');
//uid, money, YB, pf, m_exp, n_exp, reclaim, num
//用户id,金币,元宝,开通牧场,牧场经验,农场经验,农田数,红田数
$list = $_QFG['db']->fetchAll("
SELECT c.uid, c.money, c.YB, c.pf, m.exp as m_exp, n.exp as n_exp, n.reclaim, r.num FROM(
((cdb_11rpfarm_config c
LEFT JOIN cdb_11rpfarm_mc m ON m.uid=c.uid)
LEFT JOIN cdb_11rpfarm_nc m ON n.uid=c.uid)
LEFT JOIN cdb_11rpfarm_record r ON r.uid=c.uid
)
");
$count = count($list);
foreach($list as $v) {
$_QFG['db']->query("INSERT INTO uchome_qqfarm_user(uid,money,YB,pf) VALUES($v['uid'],$v['money'],$v['YB'],$v['pf'])");
if($v['pf']) {
$_QFG['db']->query("INSERT INTO uchome_qqfarm_mc(uid,exp) VALUES($v['uid'],$v['m_exp'])");
}
$_QFG['db']->query("INSERT INTO uchome_qqfarm_nc(uid,exp,reclaim) VALUES($v['uid'],$v['n_exp'],$v['reclaim'])");
}
die('OK. 转化成功 QFarm 4.6');
?>
依然无法使用~
错误照旧
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\APMServ5.2.6\www\htdocs\home\qqfarm\core\RP32toQF46.php on line 24
求高手解答 |