Ver Mensaje Individual
  #1 (permalink)  
Antiguo 17/09/2011, 17:25
robinhg_5
 
Fecha de Ingreso: septiembre-2011
Ubicación: Zacatecas
Mensajes: 8
Antigüedad: 12 años, 7 meses
Puntos: 0
Cargar dos consultas diferentes

Como estan comunidad, pues tengo un problema con un codigo php llamando procedimientos almacenados, lo que pasa que necesito obtener de 2 diferentes PA su respectivos datos, el primero es para obtener estaciones, un if para si hay estaciones cargar el siguiente PA y seguir con el siguiente if donde checo si hay locutores, si los hay realizar el proceso de pintar en pantalla los locutores en caso dde que no pues que muestre un mensaje que diga que no se encuentran locutores, en caso de que no halla estaciones que muestre en pantalla no hay estaciones, este es el codigo que tengo pero no me carga el segundo fech_object(), si alguien pudiese ayudarme se lo agradeceria.

Código:
<?
                    /*Conexion a la bd*/
include('BD.php');
$datos = $mysqli->query("CALL mostrar_estaciones()");
?>
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Estaciones</title>
        <link rel="stylesheet" type="text/css" href="css/ETablas.css" title="default"/>
    </head>
    <body>
        <?
        if ($lista = $datos->fetch_object()) {
            $datos2 = $mysqli->query("CALL mostrar_locutor()");
            if ($lista2 = $datos2->fetch_object()) {
                ?>
        <form id="formest" name="formest" method="post" action="procesaLocutor.php">
            <table width="459" border="0" align="center">
                <tr height="100"><td><b></b></td>
                    <td height="61" colspan="3"><b>Agregar Locutor  <a href="LocutorNuevo.php?id=0"><img src="images/add.png" name="nuevoloc" width="16" height="16"></a></b><b></b></td>
                    <td><b></b></td>
                </tr>
                <tr>
                    <td><b>NOMBRE</b></td>
                    <td><b>ESTACION</b></td>
                    <td><b></b></td>
                    <td><b>MODIFICAR</b></td>
                    <td><b>BORRAR</b></td>
                </tr>
                        <?
                        do {
                            echo "<tr>";
                            echo "<td><b>".$lista2->Nombre."</b></td>";
                            echo "<td><b>".$lista2->Estacion."</b></td>";
                            echo "<td><b>".$lista2->Im."</b></td>";
                            echo'<td><a href="EstacionNueva.php?id='.$lista2->idLocutor. '"><img src="images/edit.png" width="16" height="16"></a></td> ';
                            echo'<td><a href="borrarEst.php?id=' .$lista2->idLocutor. '"><img src="images/delete.png" width="16" height="16"></a></td> ';
                            echo "</tr>";
                        }while ($lista2 = $datos2->fetch_object());
                        ?>
            </table>
        </form>
            <?
            }else {
                ?>
        <table width="459" border="0" align="center">
            <tr height="100"><td><b></b></td>
                <td height="61" colspan="3"><b>Agregar Locutor  <a href="LocutorNuevo.php?id=0"><img src="images/add.png" name="nuevaest" width="16" height="16"></a></b><b></b></td>
                <td><b></b></td>
            </tr>
        </table>
            <?
            }
        }
        else {
            echo "<table align='center'>";
            echo "<tr><td>No Existen Estaciones</td></tr>";
            echo "</table>";
        }
        ?>
    </body>
</html>