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 6797447
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:36:38+00:00 2026-05-26T18:36:38+00:00

For example, say im doing a limited query function like this: function getLogList() {

  • 0

For example, say im doing a limited query function like this:

function getLogList()
{
    $table='logs';
    $result = mysql_query("SELECT id,title,timestamp,votes FROM {$table} ORDER BY count DESC LIMIT 1, 20");
    return $result;
}

If the table has lets say 460 entries, is there a way I can make my function also return the total count with its return?

  • 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-26T18:36:39+00:00Added an answer on May 26, 2026 at 6:36 pm

    Use SQL_CALC_FOUND_ROWS in conjunction with FOUND_ROWS:

    SELECT SQL_CALC_FOUND_ROWS id,title,timestamp,votes FROM {$table} ORDER BY count DESC LIMIT 1, 20;
    
    SELECT FOUND_ROWS();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How does CouchDB handles conflicts while doing bi-directional replication? For example: Lets say there
i have problem use link_to_remote link_to_remote document example say link_to_remote Delete this post, :update
Lets say for example: $(.button).click(function() { $.post(commandrunner.php, { param1: 'value', param2: 'value2', param3: 'value3'
What is the recommended way of doing date arithmetics in Perl? Say for example
I would like to improve the performance of hashing large files, say for example
can you get the last or newly added element in std::set? for example say
To use as an example: lets say that I have 2 EditText s and
How do you elegantly format a timespan to say example 1 hour 10 minutes
I have 2 websites, lets say - example.com and example1.com example.com has a database
Here is my scenario. For the example lets say that I need to return

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.