Ver Mensaje Individual
  #12 (permalink)  
Antiguo 07/06/2010, 10:41
Avatar de Most
Most
 
Fecha de Ingreso: marzo-2009
Mensajes: 642
Antigüedad: 15 años, 1 mes
Puntos: 6
Respuesta: mostrar contenido BD ¡error!

Cita:
NULL You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
Codigo actualmente:

Código PHP:
Ver original
  1. <html>
  2. <head>
  3. <title>Documento sin t&iacute;tulo</title>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  5. </head>
  6.  
  7. <body>
  8. <?php
  9. $connect=mysql_connect("","","");
  10. mysql_select_db("",$connect);
  11.  
  12.  
  13. $caratula=$_GET['caratula'];
  14. $id=$_POST['id'];
  15. var_dump($id);
  16. $id_peli = ""; //id de la peli que quieras
  17. $sql = "SELECT * FROM enlaces WHERE id = ".$id;
  18. $result = mysql_query($sql, $connect) or die (mysql_error());  
  19.  
  20. while ($row = mysql_fetch_assoc($result)) {
  21.     $nombre = $row['nombre'];
  22. }
  23. ?>
  24.  
  25. <table align="center">
  26.     <tr><td align="center"><img src="<?php echo $caratula; ?>" /></td></tr>
  27.     <tr><td align="center"><?php echo $nombre; ?></td></tr>
  28.     <tr><td>&nbsp;</td></tr>
  29.     <tr><td align="center"><a href="ver.php?ver=<?php echo $id; ?>">Ver Mas</a></td></tr>
  30. </table>
  31. </body>
  32. </html>