Jump to content


Popular Content

Showing content with the highest reputation on 11/29/2023 in all areas

  1. Before anything else, you need to add an ORDER BY clause to your query so that you can ensure a consistent order of your results. Without an ORDER BY clause, the database server is allowed to return the rows in whatever order it wants, usually that's just whatever order it finds them in as it scans the indexes/tables. As you add/remove data that order will change. Once you have your results ordered in a specific way, you can count the number of records that come before a specific row by running a query with a where condition of theOrderByColumn <= yourCurrentRowsOrderByColumn. For example. SELECT id,path, subCategoryId FROM `files` WHERE categoryId=5 AND subCategoryId=15 ORDER BY id; SELECT COUNT(*) FROM files WHERE categoryId=5 AND subCategoryId=15 AND id <= 307
    1 point
This leaderboard is set to New York/GMT-05:00
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.