Multi-table joint establishment record set is very useful, because in some cases, we need to display the digital data type as the corresponding text name, which encounters the problem of multi-table joint establishment record set. For example, a member registration system, a total of five tables, member information data sheet Member, member identity table MemberIdentity, member privilege form MemberLevel, Member Category Meter MEMBERSORT and Member Marriage Status Table WEDLOCK. If you want to display all the membership registration information, you must connect these four forms, otherwise some of the membership information you can see is just the data number. In terms of membership table, in its data table, 1 represents the ordinary member, 2 represents senior members, 3 represents a lifetime member, when displaying, if you do not associate with the member table detailed data table, then what we now Seeing a registration information of a general member, we can only see that its category is 1, and who will know that 1 representative is ordinary member? So to associate the member class table with the member detailed data sheet, after the association, 1 is displayed as a regular member, 2 is displayed as a senior member, 3 is displayed as a lifelong member, how good? Similarly, the other two tables should be associated with the member detailed data table to display the data number as the corresponding name. I have encountered this problem in the future of the website, in the bread forum, the mad club, blue ideals, and the 5D multimedia forum sent a post, there is no answer, I have to study myself, I spent two days, I finally succeeded, now Write it into a tutorial for everyone to share, I hope everyone will go less. This tutorial is to link five episodes. If you prefer, you can link more textures, the method is similar to the small look ~ Step 1: Build a database named Member based database, built five tables, They are: Member Information Data Tables Member, Member Identom Member Memberlevel, Member Category Meter Member, Member Marriage Status Table Wedlock.
● Member Information Data Sheet Member: MEMBERID: Auto Number, Primary Key (ID) MEMBERSORT: Numbers (Member Category) MEMBERNAME: Text, Member Name Password: Text (Member Password) MemberLevel: Number (Member Privilege) MEMBERIDENTITY: Number (member identity) WEDLOCK: Digital (Marital Status) MEMBERQQ: Text (QQ Number) MEMBEREMAIL: Text (Member Email) MEMBERDATE: Date / Time (Member Registration Date) ● Member Idum MemberIdentity: MemberIdentity: Auto Number, Primary key (ID number) IdentityName: Text (Member Name) ● Member Right Law Table Member, MEMBERLEVEL: Auto Number, Primary Key (ID Number) LevelName: Text (Member Name) ● Member Category Meter Member, Primary Number, Primary Key (ID Number) Sortname: Text ( Member Category Name) ● Member Marriage Status Table WEDLOCK WEDLOCK: Auto Number, Primary Key (ID Number) WEDLOCKNAME: Text (Member Marriage Status Category) Description: After the five tables are built, you can set your own categories, such as members Permissions, you can set two categories - "Unpaid members" and "paid members", numbers are "1", "2", such as you set up three options, then the number of the third option is of course "3". Below we have to ask the numbers such as "1", "2" as "unpaid members" and "paid members", otherwise, everyone will know "1" representative "unpaid members" "2" represents "paid members"? Step 2: Building a DSN Data Source, build a recordset ● Run Dreamweaver MX software, build a DSN data source named Connmember (you can also do other names) at the Member Registration Information display page. ● Click "Bind" in the server behavior panel, build a data set named Membershow, "Connect" Select Connmember, "Table" Select MEMBER, "Column", "Sort" Select MEMBERDATE, descending.
Click the "Advanced" button to modify the code that is automatically generated in the SQL box: the original code is: select * from member order by MemberDate DESC to modify the code to: select * from ((Member Inner Join Membersort on Member.Membersort = Membersort.Membersort ) INNER JOIN MemberLevel ON Member.MemberLevel = MemberLevel.MemberLevel) INNER JOIN MemberIdentity ON Member.MemberIdentity = MemberIdentity.MemberIdentity) INNER JOIN Wedlock ON Member.Wedlock = Wedlock.Wedlock ORDER BY MemberDate DESC after modifying code, click "OK", Datual! Now you can open a record set, all the fields in the five tables are integrated in the Membershow record set, and you can bind the corresponding fields in the cell you want to display. This is better, all the number numbers become the corresponding name, such as membership, no longer "1" and "2" digital form, but become the corresponding name "unpaid member" and "Paid members". Other digital numbers have also become a displayed text name, is it very happy? Note: ● In the input letter, you must use the English half-width punctuation, and the word is half a space between the words; ● When establishing a data table, if a table is coupled with multiple tables, then the fields in this table must be Is the "digital" data type, and the same field in multiple tables must be the primary key, and it is the "Auto Number" data type. Otherwise, it is difficult to join success. ● Code Nested Quick Method: If you want to connect five tables, just add a front and rear brackets on the code connected to the four tables (front brackets are added behind from the future, the posterior brackets are added at the end of the code), then Continue to add "Inner Join Name X ON Table 1." INNER JOIN Table Name "code after the rear parentheses, so you can join the data table :) Syntax format: Inner Join ... ON The format can be summarized as: from ((Table 1 Inner Join table 2 ON table 1. Field number = Table 2. Field number) Inner Join table 3 ON table 1. Field number = Table 3. Field number) Inner Join table 4 on Member. Field number = Table 4. Field number) Inner Join table x on member. Field number = Table X. Field number You can use this format. Existing format example: Although I have already understood it, I will use the membership registration system as an example for the registration system, I will provide some ready-made grammar format examples. Everyone will modify the data table name and field name. .