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

  • SEARCH
  • Home
  • 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 6592333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:32:28+00:00 2026-05-25T17:32:28+00:00

I have several SELECT statements on a PHP page, and I used Dreamweaver to

  • 0

I have several SELECT statements on a PHP page, and I used Dreamweaver to generate those.

After going through the code it generated, there seemed to be alot of fluff which I could cut out under most circumstances, a mysql_num_rows() line for each statement being an example.

So I’m wondering if anyone can tell me whether or not this actually saves resources – considering the query is being run regardless, is there any actual overhead for this?


UPDATE:
After following Chriszuma’s suggestion about microtime, here are my results:

//time before running the query
1: 0.46837500 1316102620

//time after the query ran
2: 0.53913800 1316102620

//time before calling mysql_num_rows()
3: 0.53914200 1316102620

//time after mysql_num_rows()
4: 0.53914500 1316102620 

So not much overhead at all, it seems

  • 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-25T17:32:29+00:00Added an answer on May 25, 2026 at 5:32 pm

    I would expect that such a call would have an extremely minimal impact on performance. It is just counting the rows of its internally-stored query result. The SQL query itself is going to take the vast majority of processing time.

    If you want to know for sure, you can execute microtime() before and after the call to see exactly how long it is taking.

    $startTime = microtime(true);
    mysql_num_rows();
    $time = microtime(true) - $startTime;
    echo("mysql_num_rows() execution: $time seconds\n");
    

    My suspicion is that you will see something in the microseconds range.

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

Sidebar

Related Questions

I have a PHP script with one select query and several prepared update statements.
I have several select tags on a page and I am grouping them using
We have several pages generated using PHP on our website with the following titles
I have several statements which access very large Postgresql tables i.e. with: SELECT a.id
I'm writing some php/html code. I have a css file that has several backgrounds.
I currently have several if statements that populate a specific table after the button
I have a query that makes several calls within a SELECT statement to a
I am using MySQL. I have several lookups like this: SELECT * from users
Say I have a stored procedure consisting of several separate SELECT, INSERT, UPDATE and
I have... a dynamic populated select box several input boxes a submit button form

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.