Ask tall Man: data import and export between two PHP platforms

Source: Internet
Author: User
Tags bulk insert
PHP Moodle Data transfer

Demand:
The Student information (user name, password, name, email, select Professional code) in the enrollment platform is imported into the corresponding data table in the Moodle platform database.
Enable students to use usernames and passwords on the Moodle platform to log on to the Moodle system for online learning and taking course quizzes,
After the test is completed, the student's results (user name, professional code, course name, course results) are exported to the enrollment platform, students can view their own performance information.
Requirements:
These actions are automatically updated every 0 o'clock in the morning, and the student information and student scores are automatically imported and exported.
Now need to write a script file, timed execution, ask the expert pointing, do the main steps of this function, in different platforms between different databases of data transmission should be used to save the transition, arrays or files? Or a session, a cookie?
Online, etc...


Reply to discussion (solution)

Didn't do it, make a thought.

Interface for data transfer. The B platform executes PHP files on a daily basis, requesting the interface corresponding to the A platform. A platform will pass the new data through the interface to B platform, B platform received after storage.

It should be possible to use shell scripts.

2 platforms can directly mutual access to the database, if possible, directly with shell script from a library to insert B library.

If you can't, then you need to develop a responsive interface

Insert database to drop active pull data:
Enrollment platform needs to provide bulk access to user information interface
Moodle platform provides bulk score information interface

Insert Database Passive update data:
Enrollment platform needs to provide an interface for bulk INSERT score information
Moodle platform provides bulk INSERT user information interface

Both communication can use post JSON or directly download TXT file

However, the above are closely related to the insertion, without involving the updating of the problem, updated issues such as
A user has been in the Moodle platform, but a user's password in the enrollment platform modified, then Moodle How to sync this password?
You can't always update all users.

So the best way is to sign up for the enrollment platform to provide SSO, to keep the enrollment platform and Moodle platform synchronization landing log out is the king.

The first thing to determine is the next database, if available, through a third-party tool.

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