MYSQL extracts the first and last records of a record. MYSQL extracts the first and last records of a record? How to write? Thank you! ------ Solution --------------------...... This ...... Use SQL statements. MySQl in php does not exist like the recordset in ASP. Therefore, you can only use SQL. That is to say, read three pieces of information at a time in the order you read. The first one is for MYSQL to retrieve the first and last records of a certain record.
How does MYSQL retrieve the first and last records of a record? How to write? Thank you!
------ Solution --------------------
......
This ...... Use SQL statements.
MySQl in php does not exist like the recordset in ASP. Therefore, you can only use SQL. That is to say, according to your reading order, three pieces of information are read at a time. The first is the ID of the previous one, the third is the next ID, and the second is the read ID. In this case, it seems that the problem has been solved ...... Put all these items in an array (You can also read the IDs of all the information at a time. However, if the data link is very large, it may be a problem. If you add the limit, you can ~ But there is still a problem ...... A lot of problems ...... When turning pages ...... It seems that this is not a return ......)
How can I find a solution in a few days ~ Busy recently
------ Solution --------------------
SELECT * FROM 'softinfo' WHERE info_id> 20-2 AND info_id <> 20 LIMIT 0, 2 can only be done with incremental segments!
------ Solution --------------------
... You think too much. I don't know how to try it!
------ Solution --------------------
Oh, right. Let me think about it again.
------ Solution --------------------
(SELECT * FROM 'softinfo' WHERE info_id <20 order by info_id DESC limit 0, 1) union (SELECT * FROM 'softinfo' WHERE info_id> 20 limit 0, 1) this should be done. I cannot think of any better at the moment.