![enojado](http://static.forosdelweb.com/fdwtheme/images/smilies/enojado.png)
Código PHP:
/*
Método que se emplea para la carga de la matriz que va a contener los datos a mostrar, se emplea solo para SQL Server y MySQL
*/
function cargarArray($rs = '', $QRY='', $driver, $dbase){
switch ($driver){
case "mysql":
$this->dbOpen("mysql", $dbase);
if (strlen($QRY) > 0){
$rs= mysql_query($QRY, $this->dsn) or die("Error: "."<BR>Query: $query");
}
$totalFilas = mysql_num_rows($rs);
$totalCampos = mysql_num_fields($rs);
break;
default:
$this->dbOpen();
if (strlen($QRY) > 0){
$rs= mssql_query($QRY, $this->dsn) or die("Error: "."<BR>Query: $query");
}
$totalFilas = mssql_num_rows($rs);
$totalCampos = mssql_num_fields($rs);
break;
}
$this->arrayRs = array(0);
for ($i = 0; $i < $totalFilas; $i++ ) {
switch ($driver){
case "mysql":
$row = mysql_fetch_array($rs);
break;
default:
$row = mssql_fetch_array($rs);
break;
}
$this->arrayRs[$i] = $row;
}
switch ($driver){
case "mysql":
mysql_free_result($rs);
$this->dbClose("mysql");
break;
default:
mssql_free_result($rs);
$this->dbClose();
break;
}
}
Código PHP:
//generar etiquetas
case 99:
$this->PDF();
$this->AddPage();
$query= "SELECT DISTINCT nombreEquipo as Equipo, sbn as Serial, nroEquipo as Nro, nombreLab as Lab
FROM equipo, estados, laboratorio
WHERE equipo.idLab = laboratorio.idLab
AND laboratorio.idLab = '".$_REQUEST['id']."'
AND equipo.idEstado = estados.idEstado
AND estados.idEstado NOT IN ('-1')
ORDER BY Nro";
$this->cargarArray('',$query);
$totalRows = count($this->arrayRs);
$j=0;
foreach($this->arrayRs as $key){
$this->dbOpen();
$j++;
if ($j === 11){
$this->AddPage();
$j=0;
}
$cad = "";
$cad = $key;
$this->Tags($cad,true);
$this->dbClose();
$this->Ln();
$i++;
}
break;
Código PHP:
//Ficha de Perfil del Laboratorio
case 310:
$this->AddPage();
//Cargos
$this->SetFont('Arial','',5);
$query= "SELECT DISTINCT idGrupo
FROM grupos";
$this->cargarArray('',$query,'mysql','seguridad');
reset ($this->arrayRs);
foreach($this->arrayRs as $key => $value){
$cad = "";
$cad = $value;
echo($cad);
}
print_r($this->arrayRs);
break;
y al hacerle print_r($this->arrayRs): Array ( [0] => Array ( [0] => 1 [idGrupo] => 1 ) [1] => Array ( [0] => 2 [idGrupo] => 2 ) [2] => Array ( [0] => 3 [idGrupo] => 3 ) [3] => Array ( [0] => 4 [idGrupo] => 4 ) )
¡¡¡¡ALGUNA AYUDA PLEASE!!!!