
31/03/2016, 10:40
|
| | Fecha de Ingreso: abril-2012 Ubicación: Chile
Mensajes: 2
Antigüedad: 12 años, 11 meses Puntos: 0 | |
Respuesta: recorrer mysql_fetch_array de forma automatica $buscar = mysql_query("SELECT * FROM producto WHERE rel_empresa_id='2'");
while ( $campos = mysql_fetch_field($buscar) ){
$la_fila[] = $campos->name;
}
for ( $i=0; $i<count($la_fila); $i++ ){
echo $la_fila[$i];
echo ' | ';
}
while ( $row = mysql_fetch_array($buscar) ){
echo 'line: <br>';
for ( $i=0; $i<count($la_fila); $i++ ){
echo $row[$la_fila[$i]];
echo ' ';
}
} |