$query1 = "SELECT date_temp, AVG('.$takeinput.') FROM sample where date_temp = '$a'";
$result1 = mysql_query($query1);
while($row = mysql_fetch_array($result1))
{
$date = $row['date_temp'];
$air = $row['AVG('.$takeinput.')'];
if($counter<$u && $air>-1)
{
echo "<tr>";
echo "<td>" . $date . "</td>";
echo "<td>" . $air . "</td>";
echo "</tr>";
$dataSet->addPoint(new Point("$date", $air));
$counter++;
}
}
this is the code snippet after mking changes...stilll same index problem...this dynamic variable assigning works well with query like "select * from sample where date='$d'" but fails with when i try to use with sql function like COUNT() or AVG()..