I want to fetch some data from my database which something weird came out.
<?php
include("conmysql.php");
$selectdb = @mysql_select_db("vote");
if (!$selectdb) die("Connect database fail!");
//find number of people supporting
$sql = 'SELECT COUNT(support) FROM address WHERE support=1';
$result = mysql_query($sql);
if (!result) {
die('Invalid query: ' . mysql_error());
}
echo "$result";
?>
the 'support' variable is set to boolean, where I want to get all the number of 1s.
and the result came out to be 'Resource id #4'. Can someone help!