Hi,

I have the following code that is failing because the field is varchar, but is expecing int..

Code:
$query = "SELECT COUNT(*) as Num FROM products WHERE productgroup = 'Some Group'";

	$total_pages = mysql_fetch_array(mysql_query($query));
	$total_pages = $total_pages[num];
I was under the assumtion that if I changed:

SELECT COUNT(*)

to

SELECT COUNT(pid) <-- pid field is int

That it would use that field to count results, not the productgroup field?


Thanks