Ver Mensaje Individual
  #9 (permalink)  
Antiguo 17/01/2008, 07:19
Avatar de liliancita
liliancita
 
Fecha de Ingreso: diciembre-2007
Mensajes: 189
Antigüedad: 17 años, 3 meses
Puntos: 0
Re: como trabajar con multiples valores

hola

Código PHP:
<tr>
<td>Total registro</td>
</t>
<?
$sql
=("SELECT idfiltro FROM `filtro`WHERE nombre = '".$nom."'");  
$result=mysql_query($sql,$link); 
$varmysql_fetch_assoc($result); 

$sql1=("SELECT iddato FROM `datos`WHERE datoreal = '".$dat."'");  
$result1=mysql_query($sql1,$link); 
$valor=mysql_fetch_assoc($result1); 

$total=array();
foreach(
$var as $k => $v){
   foreach(
$valor as $k2 => $v2){
  
 
$v++; // toma el segundo y tercer valor

    
$sql=("SELECT COUNT(*) FROM registo 
    WHERE YEAR(fecha) = YEAR(DATE_ADD(NOW(), INTERVAL 0 YEAR))
    AND MONTH(fecha) = MONTH(DATE_ADD(NOW(), INTERVAL 0 MONTH))
    AND idfiltro='$v' 
    AND iddato='$v2'"
);
    
        
$result=mysql_query($sql,$link);
    
$rowmysql_fetch_array($result);
como ves le agregue un $v++, y asi me toma el segundo y tercer dato del arreglo, pero no el resto, y si no hago el $v++ solo toma un dato,

y el $v2 es lo mismo me toma solo el priemro :(


saludos