top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

What is the method to find the number of rows in a result set using PHP?

+1 vote
What is the method to find the number of rows in a result set using PHP?
posted May 19, 2014 by Rahul Mahajan

Share this question
Facebook Share Button Twitter Share Button Google+ Share Button LinkedIn Share Button Multiple Social Share Button

2 Answers

0 votes

With the help of function mysql_num_rows() ,you can find out the number of rows in result set.

For Example:
$result= mysql_query($sql,$db_link);
echo "$rowcount";

answer May 20, 2014 by Mohit Sharma
0 votes

how to fetch country ,state, and city, please recomdedd me

answer Feb 26, 2018 by Edward Anny Tyagi
Similar Questions
0 votes

I have a client where their next auto-increment number just jumped from 2300 to 1000000000 for reasons not understood. They want it set back.

Options such as dropping the primary key and rebuilding the index is NOT possible -- this is a relational table thing. So, is there a way (programmatically) to set the next number in an auto-increment?

Something like:

alter table abc auto_increment = 2301;

Any ideas of why this happened?

+1 vote

which of the following is better to find the number of rows in a table?
1. count(1)
2. count(*)
3. count(rowid)

Contact Us
+91 9880187415
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Karnataka INDIA.