Ver Mensaje Individual
  #5 (permalink)  
Antiguo 21/10/2010, 09:22
sentnel
 
Fecha de Ingreso: octubre-2010
Mensajes: 122
Antigüedad: 14 años, 4 meses
Puntos: 6
Respuesta: Something wrong here and dont know what it is!

Thanks mortiprogramador!

I tried your suggestions:

- try to put echo to the $query and this is the result:

SELECT SUM(pte_circuns_her_arm_fuego) FROM jos_polnac_partediario_gen WHERE departamento_pn='1' AND fecha_hora_partediario BETWEEN DATE ('2010-10-17 17:33:00') AND ('2010-10-20 00:55:00')

- run this query that show in yog:




- if this work, then try without while, only set the var $row and show the result (row[0]):

this is the code, check if the syntax is correct (with the $row var, etc.)

Código PHP:
 <?php
                $query 
"SELECT
SUM(pte_circuns_her_arm_fuego) FROM jos_polnac_partediario_gen
WHERE departamento_pn='1' AND fecha_hora_partediario 
BETWEEN DATE ('2010-10-17 17:33:00') 
AND ('2010-10-20 00:55:00')"
;

        
$result mysql_query($query);

        
$row mysql_fetch_row($result);
        echo 
$row[0];

        
?>
and again the error:


Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in F:\xampp\htdocs\palacio\stats\stat1.php on line 17


Thanks again!