Trying to run a count query but for some reason it's not echo-ing anything out. When I put the same query into phpmyadmin I get a value so I don't understand..

	$CountQuery = "SELECT COUNT(productname) as a FROM tblproducts";
	$CountResult = mysql_query($CountQuery) or die(mysql_error().'<br />'.$CountQuery);
	while($rowc = mysql_fetch_array($result)){
		$prodsqlcount = $rowc['a'];
	}
	echo $prodsqlcount;

    Nevermind, I'm an idiot. I changed $result to $CountResult and all is fine.

      Write a Reply...