Ver Mensaje Individual
  #32 (permalink)  
Antiguo 12/08/2014, 11:18
seba_91
 
Fecha de Ingreso: agosto-2014
Ubicación: Bahia Blanca
Mensajes: 15
Antigüedad: 9 años, 8 meses
Puntos: 0
Respuesta: Problema con PHP+MySQL: Undefined Index

Cita:
Iniciado por bookmaster Ver Mensaje
Te a faltado la parte del SELECT para mostrar los comentarios.


Este insert es el que hago para grabar los comentarios.

y esto
Código:
<?php
include("connect.php");
include("funciones.php");

session_start();
// inicializamos para poder utilizar variable session
revisa_login();

$resultado=mysql_query("SELECT idusuario, comentario,fecha FROM comentarios ORDER BY fecha LIMIT 10");
?>

<!DOCTYPE html>
<html>
<head>
	<link href='http://fonts.googleapis.com/css?family=Didact+Gothic' rel='stylesheet' type='text/css'>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>LeBon Café - Libro de Visitas</title>
	<!--Adobe Edge Runtime-->
    <script type="text/javascript" charset="utf-8" src="logo-animate_edgePreload.js"></script>
     <style>
        .edgeLoad-EDGE-45223871 { visibility:hidden; }
    </style>
	<!--Adobe Edge Runtime End-->
	<link rel="stylesheet" href="css/normalize.css">
	<link rel="stylesheet" href="css/estilos.css">
	<link rel="stylesheet" href="css/animations.css">
</head>



<body>

	<header>
		<div class="holder">
			<section class="logo left"> <!--LOGO EDGE ANIMATE!-->
				<div id="Stage" class="EDGE-45223871">
				<div id="Stage_lebon1_alpha" class="edgeLoad-EDGE-107697586"></div>
        		<div id="Stage_humo_alpha" class="edgeLoad-EDGE-107697586"></div>
        	</section>
   		 </div>


   		  <div class="social right">
			<object width='69' height='32'><embed src='http://www.socialbuttonmaker.com/Swfs/648701fc-01e9-4de4-9d5a-f3ee6a7971f7/button.swf' type='application/x-shockwave-flash' width='69' height='32' loop='false' wmode='transparent'><noscript><a href='http://onelottowin.com/'>onelottowin.com</a></noscript></embed><img src='' width=0 height=0 id='flashbutton'/><script type='text/javascript' src='http://www.socialbuttonmaker.com/Scripts/FlashButton.js'></script></object>
   		</div>

</header>

<nav class="stretchRight"> <!--Animacion nav!--> 
	 <div class="visita">	
		<div class="holder">
			<ul>
				<li><a class="activo" href="visitas.php" title="">Libro de visitas</a></li><li>
				
			</ul>
		</div>
	 </div>
	</nav>



<div class="visitas">
	<p>Usuario Actual:
	<?php echo nombre_usuario($_SESSION['idusuario']);
		//nombre_usuario>funcion que creo en funciones.php
	?></p>	

	<a href="ingreso_comentario.php">Agregar comentario</a> - <a href="salir.php">Cerrar sesión</a>
		<?php while($fila=mysql_fetch_array($resultado)) { ?>
			<form action="borrar.php" method="post">
				<input type="hidden" name="idcomentario" value="<?php echo $fila['idcomentario']; ?>">
				
				<table border="1">
					<tr>
						<td>Autor</td>
						<td><?php echo nombre_usuario($fila['idusuario']); ?></td>
					</tr>

					<tr>
						<td>Fecha</td>
						<td><?php echo $fila['fecha']; ?></td>
					</tr>

					<tr>
						<td>Comentarios</td>
						<td><textarea name="text" id="comen" rows="5"><?php echo $fila['comentario']; ?></textarea></td>
					</tr>

					<td><input type="submit" name="submit" value="borrar comentario"/></td>	
			</form>

					<br>
					</br>
					
				</table>
			
		<?php } //cierra while?>
</div>	

</body>
</html>
es todo mi visitas.php donde se muestran