Hi ,
I'm trying to get the max no. of rows in a table using "select count(*) from country" like in the below code but I cant get to output it. Any ideas?
mysql_connect($localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT count(*) FROM country";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
Also I want to do some percentages like
if the above give me a total row count = 10
and another sql for eg: select count() from country where id = 3 gives me 4, I want to do a (4/10)100 = 40%
any ideas would be great.
regards,
Joe