Ver Mensaje Individual
  #8 (permalink)  
Antiguo 13/05/2009, 04:20
nervio
 
Fecha de Ingreso: abril-2009
Mensajes: 106
Antigüedad: 15 años, 1 mes
Puntos: 1
Respuesta: ayuda con getrows

perdona! aki te dejo el codigo y muxas gracias de nuevo!

Código PHP:
function GetRows($handle)
{  
    
/*
       This function emulates the ASP GetRows function. It creates a 2 dimensional
       array of the data set where the :

       1st dimension is the row number of the data
       2nd dimension are the data fields

       Returns a two dimensional array if there are record or false if no records
       come out of the query
    */

    
if (mysql_num_rows($handle)>0){

        
//initialize the array
        
$RsArray1   = array();

        
//loop thru the recordset
        
while ($rows mysql_fetch_array($handle))
        {
            
$RsArray1[] = $rows;
        } 
//wend
        
return $RsArray1;
    }else{
        
//no records in recordset so return false
        
return false;
    } 
//end if
    //close the connection
    
mysql_close($handle);

//end function
                        
$sql1=mysql_query("SELECT * FROM `cliente`");
                        
$res1=GetRows($sql1);
                        echo 
$res1(0,0);
                        echo 
$res1(1,0);