Example
<?php
$link = mysql_connect("localhost", "mysql_user", "mysql_password");
mysql_select_db("database", $link);
$result = mysql_query("SELECT * FROM table1", $link);
$num_rows = mysql_num_rows($result);
echo "$num_rows Rows\n";
?>
Warning
This extension was deprecated in PHP 5.5.0, and it was removed in PHP 7.0.0. Instead, the MySQLi or PDO_MySQL extension should be used. See also MySQL: choosing an API guide and related FAQ for more information. Alternatives to this function include:
- mysqli_num_rows()
- mysqli_stmt_num_rows()
- PDOStatement::rowCount()
The function mysql_num_rows() returns the number of rows in a result set.
![image](/images/gyapti/user/93/anilbisht.jpg)
Anil Bist
Skills Php
Qualifications :- High School - SLV, College/University - Graphic Era Deemed Univ University,Location :-Dehradun,Dehradun,Uttarakhand,
Description:-
I started my Professional Journey in 2006 with one of the Web Development Company in Bangalore and my 1st framework was "Ruby on Rail" as Web development and delivered around 5+ Projects using this platform. Then came another dimension as JEE/Sturst framework, Gradually I realized that I want to build something on my own and give my passion and energy on creating something different a
Explore
Students (5)
![](/Classroom/images/question.png)
![image](/images/gyapti/user/403/live_rauthanshubham.jpg)
![](/Classroom/images/question.png)
![](/img/default/default.jpg)
![](/Classroom/images/question.png)
![](/img/default/default.jpg)
![](/Classroom/images/question.png)
![](/img/default/default.jpg)
![](/Classroom/images/question.png)
![image](/images/gyapti/user/164/1499153505_866_hidden_face_girls_stylish_profile_pics_dp_for_whatsapp_facebook.jpg)
Recommended Classes
![image](/images/gyapti/user/93/anilbisht.jpg)
![image](/images/gyapti/user/673/IMG_2472_JPG.jpg)
![image](/images/gyapti/user/673/IMG_2472_JPG.jpg)