Skip to content

Instantly share code, notes, and snippets.

@abdullahbutt
Created October 21, 2013 07:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abdullahbutt/7079959 to your computer and use it in GitHub Desktop.
Save abdullahbutt/7079959 to your computer and use it in GitHub Desktop.
mysql_num_rows() from php.net http://www.php.net/function.mysql-num-rows
<?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";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment