ketanco
05 Oct 2008, 06:02 PM
I know it is simple but can not figure out why i can not count the rows in my mysql table, (called answers1)...This only gives an output of : Resource id #2
I dont understand what that means, nor it gives me any count result...
<?php
//Connect To Database
$hostname=xxxxxxxxxx;
$username=xxxxxxxxxx;
$password=xxxxxxxxxx;
$dbname=xxxxxxxxxxxx;
mysql_connect($hostname,$username, $password) OR DIE ('Unable to connect to database! Please try again later.');
mysql_select_db($dbname);
$query=" select count(response) FROM answers1";
//I also tried $query="count(*) FROM answers1";
$total=mysql_query($query);
echo"</br>";
echo"</br>";
echo $total;
?>
I dont understand what that means, nor it gives me any count result...
<?php
//Connect To Database
$hostname=xxxxxxxxxx;
$username=xxxxxxxxxx;
$password=xxxxxxxxxx;
$dbname=xxxxxxxxxxxx;
mysql_connect($hostname,$username, $password) OR DIE ('Unable to connect to database! Please try again later.');
mysql_select_db($dbname);
$query=" select count(response) FROM answers1";
//I also tried $query="count(*) FROM answers1";
$total=mysql_query($query);
echo"</br>";
echo"</br>";
echo $total;
?>