Buenas.
Realicé el siguiente código para recuperar la estructura de las tablas, vistas y procedimientos de mysql.
<?php
$server = "servidor";
$user = "user";
$pass = "pass";
$database = "database";
$connection=mysql_connect("$server","$user","$pass")or
die("Error conectando a la base de datos"); $db=mysql_select_db("$database",$connection) or
die ("Error seleccionando la base de datos"); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Tablas</title>
</head>
<body>
<center>Tablas de la base de datos <?php echo $database?></center>
<form id="form1" name="form1" method="post" action="">
<center>
<input type="submit" name="Buscar" id="Buscar" value="Buscar" />
</center>
</form>
<?php
if(isset($_POST['Buscar'])){ $queryTables="SHOW FULL TABLES FROM ".$database." WHERE table_type='BASE TABLE';";
$resultTables=mysql_query($queryTables) or
die('Error, query failed'); if($countTables!=0){
?>
<center><?php echo "<br><br>".$countTables." Tablas"?></center>
<table width="972" border="1" align="center">
<tr>
<th width="9%" height="24" scope="col">NOMBRE</th>
<th width="14%" scope="col">SCRIPT</th>
</tr>
<?php
$queryTable="SHOW CREATE TABLE ".$arrayTables[0];
?>
<tr>
<td><?php echo $arrayTable[0]?></td>
<td><?php echo $arrayTable[1]?></td>
</tr>
<?php
}
?>
</table>
<?php
}
$queryViews="SHOW FULL TABLES FROM ".$database." WHERE table_type='VIEW';";
if($countViews!=0){
?>
<center><?php echo "<br><br>".$countViews." Vistas"?></center>
<table width="972" border="1" align="center">
<tr>
<th width="9%" height="24" scope="col">NOMBRE</th>
<th width="14%" scope="col">SCRIPT</th>
</tr>
<?php
$queryView="SHOW CREATE TABLE ".$arrayViews[0];
?>
<tr>
<td><?php echo $arrayView[0]?></td>
<td><?php echo $arrayView[1]?></td>
</tr>
<?php
}
?>
</table>
<?php
}
$queryProcedures="SHOW PROCEDURE STATUS WHERE Db='".$database."'";
$resultProcedures=mysql_query($queryProcedures) or
die('Error, query failed'); if($countProcedures!=0){
?>
<center><?php echo "<br><br>".$countProcedures." Procedimientos"?></center>
<table width="972" border="1" align="center">
<tr>
<th width="9%" height="24" scope="col">NOMBRE</th>
<th width="14%" scope="col">SCRIPT</th>
</tr>
<?php
$queryProcedure="SHOW CREATE PROCEDURE ".$arrayProcedures[1];
$resultProcedure=mysql_query($queryProcedure) or
die('Error, query failed'); ?>
<tr>
<td><?php echo $arrayProcedure[0]?></td>
<td><?php echo $arrayProcedure[2]?></td>
</tr>
<?php
}
?>
</table>
<?php
}
}
?>
</body>
</html>
En el servidor local no hay problema para mostrarme la estructura de las tablas, vistas y procedimientos, pero al montarlo al hosting no muestra la estructura de los procedimientos.
local
(http://a4.sphotos.ak.fbcdn.net/hphotos-ak-ash4/431926_367907143236084_100000504053506_1491312_969583555_n.jpg)
servidor
(http://a6.sphotos.ak.fbcdn.net/hphotos-ak-snc7/s720x720/417160_367907866569345_100000504053506_1491313_1752673996_n.jpg)
Al realizar la consulta desde consola en el servidor la realiza sin problema
$queryProcedures="SHOW PROCEDURE STATUS WHERE Db='".$database."'";
(http://a3.sphotos.ak.fbcdn.net/hphotos-ak-ash4/s720x720/394046_367910479902417_100000504053506_1491316_1834189922_n.jpg)
Al realizar la consulta para obtener los datos de la tabla también la realiza sin problemas
$queryProcedure="SHOW CREATE PROCEDURE ".$arrayProcedures[1];
(http://a3.sphotos.ak.fbcdn.net/hphotos-ak-ash4/407814_367911849902280_100000504053506_1491321_952419240_n.jpg)
Si observan la estructura del procedimiento se encuentra en la posición 2 y al imprimirla es que no muestra nada.
<td><?php echo $arrayProcedure[2]?></td>
Alguien sabe como puedo solicionarlo.
Gracias