Foros del Web » Programando para Internet » PHP »

Problema con array?

Estas en el tema de Problema con array? en el foro de PHP en Foros del Web. ESTIMADOS, TENGO EL SIGUIENTE PROBLEMA. TENGO UNA CLASE CON UNA QUERY QUE CONSULTA A LA BD, TODO BIEN, PERO AL MOSTRAR LOS DATOS CON ARRAY, ...
  #1 (permalink)  
Antiguo 08/05/2010, 02:56
 
Fecha de Ingreso: noviembre-2004
Mensajes: 11
Antigüedad: 19 años, 5 meses
Puntos: 0
Problema con array?

ESTIMADOS, TENGO EL SIGUIENTE PROBLEMA. TENGO UNA CLASE CON UNA QUERY QUE CONSULTA A LA BD, TODO BIEN, PERO AL MOSTRAR LOS DATOS CON ARRAY, ME GENERA EL SIGUIENTE PROBLEMA: Parse error: syntax error, unexpected '[' in /HOME/LADIRECION/LINEA 31.

ADJUNTO CODIGOS.

PAGINA QUE MUESTRA DATOS:
<?php
//Connection statement
require_once('Connections/intranetsv.php');

ini_set('display_errors',1);
$rut='CADENARUT';

//clientes
require("clases/consultas.class.php");
$cl_datosCliente=new prueba;
$RT_CANTIDAD_CLIENTES=$cl_datosCliente->clientes($rut,'CANTIDAD');
//$cl_datosCliente->clientes($rut,'DATOS');
?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php //PHP ADODB document - made with PHAkt 3.7.1?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<?
if($RT_CANTIDAD_CLIENTES > 0){
$var_cantidad_clientes=$cl_datosCliente->clientes($rut,'CANTIDAD');
$array_dato_clientes=$cl_datosCliente->clientes($rut,'DATOS');
$i=0;
while($i < $var_cantidad_clientes){
$array_dato_clientes=[$i][0]; ---> LINEA 31!!!!
echo $array_dato_clientes=[$i][1];
echo $array_dato_clientes=[$i][2];
$i++; } ?>

<? } ?>
</body>
</html>
<?php
//$clientes->Close();
?>

LA CLASE:

<?php
class prueba {

function clientes ($rut,$eldato){

require('Connections/intranet.php');
require('includes/functions.inc.php');

$var_rut=$rut;
$var_la_info=$eldato;

// begin Recordset
// begin Recordset
echo $query_clientes = "SELECT * FROM tabla_clientes WHERE rut_usr='$var_rut'";
$clientes = $intranetsv->SelectLimit($query_clientes) or die($intranetsv->ErrorMsg());
$totalRows_clientes = $clientes->RecordCount();


if($totalRows_clientes >0){

if($var_la_info=='CANTIDAD'){
return $totalRows_clientes;

$clientes->Close();


}

if($var_la_info=='DATOS'){
$array_resultado=$intranet->GetArray[];
return $array_resultado;
}

}else{
//Si no hay información
return 0;

$clientes->Close();
}

}
// end Recordset
// end Recordset




}

?>

ESPERO PUEDAN INDICARME LA SOLUCION PARA EL ERROR

ESPERO PUEDAN INDICARM

Última edición por seckron; 08/05/2010 a las 03:36 Razón: modifiicar
  #2 (permalink)  
Antiguo 08/05/2010, 06:20
 
Fecha de Ingreso: diciembre-2009
Mensajes: 612
Antigüedad: 14 años, 4 meses
Puntos: 16
Respuesta: Problema con array?

$array_dato_clientes[$i][0];
echo $array_dato_clientes[$i][1];
echo $array_dato_clientes[$i][2];
__________________
Tengo una pregunta que a veces me tortura... ¿El loco soy yo o los locos son los demás?

Etiquetas: Ninguno
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 05:00.