PHP + MYSQL + Flash as the message book (3) [group chart] _ MySQL

Source: Internet
Author: User
PHP + MYSQL + Flash as the message book (3) [group chart] start to make (make the above preparations and the following will be well understood ):

1. SWF reads data
① And ② MySQl → PHP → SWF
PHP uses "SELECT" to retrieve from MySQl and then writes xml to SWF for reading.

2. SWF stores data
③ And ④ SWF → PHP → MySQl
SWF uses "sendAndLoad" to PHP, and PHP uses "INSERT" to MySQl.

After completion:

Other considerations:

Solve the garbled text (solve the problem of reading Chinese in the database "???? "):
Select utf8-geeral-ci encoding when you create a database with PhpAdmin.
Before the php file query statement, add: mysql_query ("set names 'utf8 '");
Php modularization (easy to modify later ):
The database connection statement is written in a separate file, such as connectdb. php.
Add require "connectdb. php" to the file where data is written (datatosql. php) and data is read (datatoxml. php.
MySQL troubleshooting function (if the operation is incorrect, it will be easily modified as prompted ):
Mysql_errno (error number); mysql_error (error cause ).
Php date functions (for more details, refer to other help ):
Data ("Ymd, l, H: I"); // 20080608, Sunday
SWF real-time refresh (ensure to read the latest data ):
Swf sends and obtains the real-time variable: data_lv.sendAndLoad ("datatosql. php? N = "+ random (9999), data_lv," post ");
Swf reads real-time xml: myXML. load ("datatoxml. php? N = "+ random (9999 ));

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.