Home > database >  Needs to be displayed on the page 2 different sets of recordset, the solution is?
Needs to be displayed on the page 2 different sets of recordset, the solution is?

Time:12-01

There are two tables: [article], [readers]
1, show that [article] list: the title, date, content
2, display/reader list: name

Such a demand, what is the solution?
Each experience great god advice please

CodePudding user response:

Now you want to come out two ideas
A, paging, page 1 read [article] table, and transmit the data to the page 2, page 2 read [readers] table record sets,
- due to other logical judgment related to the page, the feeling is very troublesome, and transmit data in a "content", have HTML code, the length have a little trouble or transcoding,
Two, union all way, will [article] table and [readers] table records set union rises, do a "source" field, more source="article", according to the article style, source="reader", shows the reader style,
- it is not very good, the specific bad to where I can 't say,

Please advice ~

CodePudding user response:

A page or two side by side in the list are like the datagrid control can, get the ID of the article, from the first control to associated with the article ID reader ID, to display the reader in the second control,

CodePudding user response:

refer to the second floor lich2005 response:
a page or two side by side in the list are like the datagrid control can, get the ID of the article, from the first control to associated with the article ID reader ID, to display the reader in the second control,

Side by side 2 list I didn't try...
I'm a PHP + mysql
Such as I search for some this afternoon

CodePudding user response:

refer to the second floor lich2005 response:
a page or two side by side in the list are like the datagrid control can, get the ID of the article, from the first control to associated with the article ID reader ID, to display the reader in the second control,


Thought for a moment, side by side 2 list, efficiency and union all seems to be the same on both sides... ?
  • Related