PHP Merge Discuz user script method, php merge Discuz script _php tutorial

Source: Internet
Author: User

PHP Merge Discuz user script method, php merge Discuz script


The examples in this article describe how PHP merges discuz user scripts. Share to everyone for your reference. Specific as follows:

A few days ago encountered a need to merge two discuz projects, a user level of about 120,000, one is 10,008. Needless to say, it must have dropped 10,008, leaving 120,000. Start to feel bad processing, the data table is associated, the new registration of a user, there are 8 tables added records, have not seen any other tables have the possibility of modifying records. At that time think womb also not clear those tables, search for a bit, found Discuz Tool. But can only lead 100,000 or less, so you can only try, and then consider, I directly in the key table to insert a record, other tables in the process of user operation may be automatically filled with relevant data, so try to export the original 10,008 users, and then wrote a PHP script directly to the 10,008 users write Uncenter The Memeber table. The test is OK. Unfortunately, user points are not in the past, but the user's user name and password are reserved.

Key steps:

1. Export the Uncenter member database of the system that you intend not to be a SQL file.
2. Run the script.

Disclaimer: This script only provides ideas, please backup good data before use, such as data loss is not related to the author. (Code is simple, do not spray)

Set_time_limit (0); $link = mysql_connect (' localhost ', ' ngjc ', ' ohft6yhhyvt5 ') or Die (' Could not connect: '. Mysql_error () ); Echo ' Connected successfully '; mysql_select_db (' NGJC ') or Die (' Could not select database '); require "sql.php";// This is replaced with the exported SQL file $arrayerr=array (), $oknum =0, $errnum =0;mysql_query ("SET NAMES UTF8"), and foreach ($sqlarr as $sql) {if (!mysql_  Query ($sql)) {$arrayerr []= $sql; $errnum + +;  } else {$oknum + +; }}echo "


Error
";p Rint_r ($arrayerr); Mysql_close ($link);

I hope this article is helpful to everyone's PHP programming.

http://www.bkjia.com/PHPjc/1043241.html www.bkjia.com true http://www.bkjia.com/PHPjc/1043241.html techarticle PHP merge discuz user script method, PHP merge Discuz script This article describes the PHP merge discuz user script method. Share to everyone for your reference. Specific as follows: A few days ago met ...

  • 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.