Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5972419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:39:18+00:00 2026-05-22T20:39:18+00:00

Which is the best (fastest) way to implement a list search in MySQL? My

  • 0

Which is the best (fastest) way to implement a list search in MySQL? My particular case is this:

  • I have a list of rules (e.g. {1, 3, 11, 5, 6, 9, 1232, 4}). It could be implemented in PHP or MySql.
  • I have a table in DB that lists applied rules (e.g. {1, 3, 6}) [table “applied”]
  • I have to choose between the list of rules the first that has not be applied yet (in the example the result is 11 because 1 and 3 have been already applied).
  • When a rule is choosen, it is executed (its associated action) and the “applied” table is updated (in the example the application inserts the 11 in the table : {1, 3, 6, 11})

Applied rules must be stored in database because only one rule is executed in each page load. Which is the best implementation for this kind of problems? Any sample code available?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T20:39:19+00:00Added an answer on May 22, 2026 at 8:39 pm

    To get the first rule which is not applied you can use

    SELECT r.* 
    FROM rules r 
    LEFT JOIN applied a ON (a.rule_id = r.id)
    WHERE a.rule_id IS NULL
    ORDER BY r.id
    LIMIT 1
    

    Then you perform the action associated with the rule, and insert a new record into applied table.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What is the best (fastest) way to implement a sliding window function with the
Which is the best and fastest way to find the element using webdriver? By.XPath
What would be your fastest, shortest (best) way to detect browser which is IE
Which is the best way of implementing a language translation for mutli -lang site.
Which is the best way (in performance and security) to send multiple parameters to
Which is the best way to sanitize content? An example... Example - Before sanitize:
What is the best, efficient and fastest way to expose an existing (class) library
What's the fastest, best way on modern Linux of achieving the same effect as
I know iOS 5.0 has Twitter integration, but what's the fastest way to implement
What's the best and fastest way to access a value from the previous iteration

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.