Ver Mensaje Individual
  #1 (permalink)  
Antiguo 26/09/2012, 11:02
Avatar de danramglez
danramglez
 
Fecha de Ingreso: septiembre-2012
Mensajes: 70
Antigüedad: 11 años, 7 meses
Puntos: 2
Problemas con el array

Código PHP:
Ver original
  1. #CREAR FUNCION
  2.     function consultas($var1,$id,$nombre,$email)
  3.     {          
  4.     /////////////////////
  5.     $arreglo = array ("$id", "$nombre", "$email");
  6.     //////////////////////
  7.     if($var1==1)
  8.       {
  9.         $ARMA = " order by".$email;
  10.         }
  11.        else if($var1==2)
  12.       {
  13.         $ARMA = " where ID='".$id."' Order by".$nombre;
  14.       }
  15.        else if($var1==3)
  16.        {
  17.         $ARMA = " where ID='".$id."'";
  18.        }
  19.      
  20.        foreach($arreglo as $imprimivalores)
  21.        {
  22.         //print_r ($imprimivalores);
  23.        }
  24.        
  25.        $Consulta = "select".$imprimivalores."from nuevo".$ARMA;        
  26.        
  27.         $sql="<p style=\"color:4F6C23;\">".$Consulta."</p><br>";
  28.         $cadena = mysql_query ($sql);  
  29.         echo $cadena;
  30.         echo $sql;[HIGHLIGHT="PHP"]
[/HIGHLIGHT]

COMO PUEDO HACER PARA QUE MI ARREGLO GUARDE LOS VALORES QUE LE ESTOY DANDO, Y NO SOLO EL ULTIMO