$result
is a resource variable returned by mysql_query
. More about resource variables: http://php.net/manual/en/language.types.resource.php
You must use other functions such as mysql_fetch_array()
or mysql_fetch_assoc()
to get the array of the query resultset.
$resultset = array();
$result=mysql_query("select * from choices where a_id='$taskid'") or die(mysql_error());
while($row = mysql_fetch_assoc($result)){
$resultset[] = $row; // fetch each row...
}
mysql_free_result($result); // optional though...
print_r($resultset);
See:
http://php.net/manual/en/function.mysql-fetch-array.php
http://php.net/manual/en/function.mysql-fetch-assoc.php
http://php.net/manual/en/function.mysql-query.php