$from_date AND utimestamp < $to_date AND id_agente_modulo = $id_agentmodule ORDER BY utimestamp DESC"; else $sql1 = "SELECT * FROM tagente_datos WHERE utimestamp > $from_date AND utimestamp < $to_date AND id_agente_modulo = $id_agentmodule ORDER BY utimestamp DESC"; $result1=mysql_query($sql1); // Render data while ($row=mysql_fetch_array($result1)){ echo $agentmodule_name; echo ","; echo $row["datos"]; echo ","; echo $row["utimestamp"]; echo chr(13); } } ?>