{"id":4440,"date":"2012-05-25T08:26:15","date_gmt":"2012-05-25T08:26:15","guid":{"rendered":"http:\/\/phpcodez.com\/?p=4440"},"modified":"2012-05-25T08:26:15","modified_gmt":"2012-05-25T08:26:15","slug":"mysql_num_rows","status":"publish","type":"post","link":"http:\/\/phpcodez.com\/mysql_num_rows\/","title":{"rendered":"mysql_num_rows()"},"content":{"rendered":"<p>It returns number of rows in result<\/p>\n<p><strong>MySQL Table &#8211; Users<\/strong><\/p>\n<p>+&#8212;-+&#8212;&#8212;+<br \/>\n| id | name |<br \/>\n+&#8212;-+&#8212;&#8212;+<br \/>\n| \u00a01 | PHP \u00a0|<br \/>\n| \u00a02 | PHP \u00a0|<br \/>\n| \u00a03 | PHP \u00a0|<br \/>\n| \u00a04 | PHP \u00a0|<br \/>\n| \u00a05 | PHP \u00a0|<\/p>\n<p><strong>Example<\/strong><\/p>\n<p>&lt;?php<br \/>\nmysql_connect(&#8220;localhost&#8221;, &#8220;root&#8221;, &#8220;phpcode&#8221;) or die(mysql_error());<br \/>\n$db_selected = mysql_select_db(&#8220;database_name&#8221;);<br \/>\necho mysql_num_rows(mysql_query( &#8220;SELECT * FROM users&#8221;));<br \/>\nmysql_close();<br \/>\n?&gt;<\/p>\n<p><strong>Output<\/strong><\/p>\n<p>5<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It returns number of rows in result MySQL Table &#8211; Users +&#8212;-+&#8212;&#8212;+ | id | name | +&#8212;-+&#8212;&#8212;+ | \u00a01 | PHP \u00a0| | \u00a02 | PHP \u00a0| | \u00a03 | PHP \u00a0| | \u00a04 | PHP \u00a0| | \u00a05 | PHP \u00a0| Example &lt;?php mysql_connect(&#8220;localhost&#8221;, &#8220;root&#8221;, &#8220;phpcode&#8221;) or die(mysql_error()); $db_selected = mysql_select_db(&#8220;database_name&#8221;); echo mysql_num_rows(mysql_query( &hellip; <a href=\"http:\/\/phpcodez.com\/mysql_num_rows\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">mysql_num_rows()<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[213,332,370],"class_list":["post-4440","post","type-post","status-publish","format-standard","hentry","category-php","tag-functions","tag-mysql","tag-php"],"_links":{"self":[{"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/posts\/4440","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/comments?post=4440"}],"version-history":[{"count":0,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/posts\/4440\/revisions"}],"wp:attachment":[{"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/media?parent=4440"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/categories?post=4440"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/tags?post=4440"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}