![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
18/10/2011, 10:48
|
| | Fecha de Ingreso: julio-2011
Mensajes: 161
Antigüedad: 13 años, 6 meses Puntos: 3 | |
Respuesta: Sacar dato de arreglo Lo hice asi y me me funciona
$codigo = "prueba10";
include("conexion.php"); //conexion
$registros = mysql_query("select id,op_dato from op_datos", $conexion) or
die("Problemas en el select:" . mysql_error());
while ($reg = mysql_fetch_array($registros)) {
$categoriaid1[] = $reg['id'];
$categoriades2[] = $reg['op_dato'];
}
$numc = mysql_num_rows($registros);
$registros=mysql_query("select op_codigo,op_chk_solicitados from op_frm_solicitar where op_codigo='$codigo'",$conexion) or
die("problemas en el select:".mysql_error());
$reg=mysql_fetch_array($registros);
$entregables = $reg['op_chk_solicitados'];
$sel = $entregables;
$s = explode(',', $sel);
for ($x=0; $x<$numc; $x++) {
if (in_array($categoriaid1[$x], $s)) {
echo "<td>$categoriades2[$x]</td>";
echo "<br>";
}
}
pero lo que quiero es comparar, si es 1 imprime tal cosa, si es dos otra cosa ... |