Hi All,
Im accessing a function with paticular parameters, but my response is not recognising the parameter of the count value.
If I change the variable in the COUNT part of the query to a static value it works fine, but if i use the variable name it returns "undefined index".
Any help would be greatly appreciated
<?php
class answers {
function totals($questionName, $startdate, $enddate, $advisor){
$SQL = "SELECT COUNT($questionName) FROM interview_answers i, accounts a WHERE a.client_id = i.client_id AND advisor = '$advisor' AND sesdate>= '$startdate' AND sesdate<='$enddate'";
$result = mysql_query($SQL);
$row = mysql_fetch_assoc($result);
echo $totalresponses = $row['COUNT($questionName)'];
}
}
?>