Forum Moderators: coopster
I'm trying to count the total # of records called using:
$num_result = mysql_query("SELECT COUNT(*) FROM picdata where PicSection= '$view' LIMIT $current,$maxresults ") or exit(mysql_error());
echo $num_result;
and it kind of works by giving me back:
Resource id #4
but i only want the number and not the additional text.
how can this be done?
thanks in advance for your time!
-Ken
$query = mysql_query("SELECT COUNT(*) as total FROM picdata where PicSection= '$view' LIMIT $current,$maxresults ") or exit(mysql_error()); $theRow = mysql_fetch_array($query, MYSQL_ASSOC); $num_results = $theRow['total'];
this is my code so far:
$link = mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable to connect to database");
$db_selected = mysql_select_db($DBName, $link) or die('Database name incorrect');
$num_result = mysql_query("SELECT COUNT(*) FROM picdata where PicSection= '$view' LIMIT $current,$maxresults ") or exit(mysql_error());
any ideas?
thanks again!
-Ken
and notice the LIMIT,
the values would be:
$current = 9
$maxresults = 9
so the result should only be 9, right now it's showing 25. is there a way to just show the number of records being called?
thanks again!
-Ken