How to make the recordset "content does not recur"

Source: Internet
Author: User
MySQL PHP String Function database

 
 






 
 
    


  • I want to put $row _hx[' Content_original_autor ' in the database; It is shown by a page of 10, but the repeated display is removed, that is to say $row _hx[' content_original_autor '; If you have the same content, it is not displayed.


    Reply to discussion (solution)

    Your estimate is to put the value in the array to handle.

    Two ways of thinking
    1.array_unique de-duplication (for the purpose of leaving the key for the first occurrence of the value) and then using Array_diff to find the difference set of Array_keys
    The key is not displayed in the difference set
    This method typically takes the data into array processing

    2. Build an empty array A, show each time if there is no inside a, add it, and show if the value already exists in a, skip

    SQL is grouped by Content_original_autor.
    ... Group by Content_original_autor

    Two ways of thinking
    1.array_unique de-duplication (for the purpose of leaving the key for the first occurrence of the value) and then using Array_diff to find the difference set of Array_keys
    The key is not displayed in the difference set
    This method typically takes the data into array processing

    2. Build an empty array A, show each time if there is no inside a, add it, and show if the value already exists in a, skip

    I just got this thing, I'm not sure I can keep you in touch, I'll ask you.

    $query _HX = "SELECT * from Content_publish GROUP by Content_original_autor ORDER by content_id DESC";
    Give it a try

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