本帖最后由 whj888 于 2009-11-11 19:54 编辑
买老虎出现 “请求超时,请稍后再试”,其他修改都按要求做了,包括程序和数据库也改了,所有补丁都用上了, ...
whj888 发表于 2009-11-11 12:51
原来是我用添加方式不行,原因未明,后来在数据库完全更新一次,就可以买了- UPDATE `uchome_plug_newfarm` set dog='{"1":{"id":8888,"dogValidTime":1,"status":0,"dogFeedTime":0,"dogUnWorkTime":0},"2":{"id":8889,"dogValidTime":0,"status":0,"dogFeedTime":0,"dogUnWorkTime":0},"3":{"id":8890,"dogValidTime":0,"status":0,"dogFeedTime":0,"dogUnWorkTime":0},"4":{"id":8891,"dogValidTime":0,"status":0,"dogFeedTime":0,"dogUnWorkTime":0},"5":{"id":8892,"dogValidTime":0,"status":0,"dogFeedTime":0,"dogUnWorkTime":0},"6":{"id":8893,"dogValidTime":0,"status":0,"dogFeedTime":0,"dogUnWorkTime":0},"7":{"id":8894,"dogValidTime":0,"status":0,"dogFeedTime":0,"dogUnWorkTime":0},"8":{"id":8895,"dogValidTime":0,"status":0,"dogFeedTime":0,"dogUnWorkTime":0},"9":{"id":8896,"dogValidTime":0,"status":0,"dogFeedTime":0,"dogUnWorkTime":0}}'
复制代码 注意用以上代码完全更新就会初始化,会使原来的狗全部消失了。
如果原来的数据比较多,又想用老虎,可以尝试下用批量添加方式:下面是程序,可以实现把老虎的代码批量,添加进数据库。用法:把以下代码保存为PHP文件,放到newfarm目录下执行。- <?php
- include_once('../common.php');
- $query = $_SGLOBAL['db']->query( "SELECT uid,dog FROM ".tname( "plug_newfarm" )." ");
- while ( $value = $_SGLOBAL['db']->fetch_array( $query ) )
- {
- $alwin= $value['dog'];
- $key3="}}" ;
- $key4="},"9":{"id":8896,"dogValidTime":0,"status":0,"dogFeedTime":0,"dogUnWorkTime":0}}" ;
- $alwin= str_replace($key3,$key4,$alwin);
- $_SGLOBAL['db']->query("UPDATE ".tname('plug_newfarm')." set dog='".$alwin."' where uid=".$value['uid']);
- }
- echo('<HTML>
- <HEAD>
- </HEAD>
- <BODY>
- 成功转换!
- </BODY>
- </HTML>
- ');
- exit();
- ?>
复制代码 |