Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // way 1
- $cat = $_GET['cat'];
- $sql = mysql_query("SELECT * from tablename where idcattegory='$cat'");
- $count = mysql_num_rows($sql);
- echo "There are $count rows in table..";
- // way 2
- $cat = $_GET['cat'];
- $sql = mysql_query("SELECT count(*) as total from tablename where idcattegory='$cat'");
- $data= mysql_fetch_array($sql);
- echo "There are $data[total] rows in table..";
Advertisement
Add Comment
Please, Sign In to add comment