Problems with upgrading from Discuz Forum 2.5 to PHPMySQL

Source: Internet
Author: User
1 Chinese problem, in the use of MySQL instance configuration tool, set the character set used to GBK, instead of set to UTF-82MySQL after installation password inaccessible problem: mysqlSETPASSWORDFOR-some_user @ some_hostOLD_PASSWORD (newpwd ); 3PHP has Warning in php. find bug_comba in ini

1 Chinese problem, when using MySQL instance configuration tool, set the character set to GBK instead of UTF-8

2. the password cannot be accessed after MySQL is installed:

Mysql> SET PASSWORD
->'Some _ user' @ 'some _ host'= OLD_PASSWORD ('newpwd ');

3. PHP has Warning

In php. ini, find
Bug_combat_warning = 1. change 1 to 0.

4. MySQL performs a stronger format check on SQL INSERT. Therefore, if a column is an integer, ''cannot be used for insert. Therefore, a function of Discuz is modified as follows:

Function updatesession (){
If (empty ($ GLOBALS ['sessionupdated']) {
Global $ db, $ sessionexists, $ sessionupdated, $ sid, $ onlineip, $ discuz_uid, $ discuz_user, $ timestamp, $ groupid, $ styleid, $ invisible, $ discuz_action, $ fid, $ tid, $ onlinehold, $ logincredits, $ table_sessions, $ table_members, $ user_lastactivity, $ onlinehold;

If ($ sessionexists = 1 ){
$ Db-> query ("UPDATE $ table_sessions SET uid = '$ discuz_uid', username = '$ discuz_user', groupid = '$ groupid', styleid = '$ styleid ', invisible = '". ($ invisible = ""? 0: 1). "', action =' $ discuz_action ', lastactivity =' $ timestamp ', fid ='". ($ fid = ""? 0: 1). "', tid ='". ($ tid = ""? ). "'Where sid = '$ sid '");
If ($ onlinehold & $ user_lastactivity & $ timestamp-$ user_lastactivity> $ onlinehold ){
$ Db-> query ("UPDATE $ table_members SET lastvisit = lastactivity, lastactivity = $ timestamp WHERE uid = '$ discuz_uid'", 'unbuffered ');
}
} Else {
$ Ips = explode ('.', $ onlineip );

$ Db-> query ("delete from $ table_sessions WHERE sid = '$ sid' OR lastactivity <($ timestamp-$ onlinehold) OR ('$ discuz_uid' <> '0' AND uid = '$ discuz_uid ') OR (uid = '0' AND ip1 = '$ ips [0]' AND ip2 = '$ ips [1]' AND ip3 = '$ ips [2]' AND ip4 = '$ ips [3]' AND lastactivity> $ timestamp-60) ");
$ Db-> query ("insert into $ table_sessions (sid, ip1, ip2, ip3, ip4, uid, username, groupid, styleid, invisible, action, lastactivity, fid, tid)
VALUES ('$ sid', '$ ips [0]', '$ ips [1]', '$ ips [2]', '$ ips [3]', '$ discuz_uid', '$ discuz_user', '$ groupid', '$ styleid ','". ($ invisible = ""? 0: 1). "',' $ discuz_action ',' $ timestamp', '". ($ fid = ""? 0: 1). "','". ($ tid = ""? 0: 1 )."')");
If ($ discuz_uid ){
$ Db-> query ("UPDATE $ table_members SET credit = credit ". intval ($ logincredits ). ", lastip = '$ onlineip', lastvisit = lastactivity, lastactivity = $ timestamp WHERE uid =' $ discuz_uid '", 'unbuffered ');
}
}
$ Sessionupdated = 1;
}
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.