funcion para retornar arreglo
| From: | Martin | Date: | Sat, 10 Sep 2005 21:51:00 +0000 |
| Subject: | funcion para retornar arreglo | ||
| Groups: | php.general.es | ||
| Request: | Send a blank email to general-es+get-55884@lists.php.net to get a copy of this message | ||
Hola a todos,
He creado una función en la cual me debe retornar un arreglo, pero a la hora
de listar los datos del arreglo no me sale nada, podrian indicarme si estoy
haciendo algo mal o que podria hacer.
Muchas gracias por su tiempo.
Slds.
Martin.
<?php
include("conecta.php");
function lista($num){
$get_lista=select lista from listas where id='$num';
$get_lista_result=mysql_query($get_lista) or die(mysql_error()); //obtengo
una coluna con varias filas
while( $row = mysql_fetch_array($get_lista_result) ){
$i++;
$arreglo[] = $row[$torneo_serie]; //creo mi arreglo
}
return array($arreglo); //retornar el arreglo
}
?>
<?php
lista(1);
foreach($arreglo as $i)
{
echo "$i";
}
?>