Ver Mensaje Individual
  #25 (permalink)  
Antiguo 06/08/2011, 15:54
SantosMc03
 
Fecha de Ingreso: agosto-2011
Ubicación: en mi casa
Mensajes: 37
Antigüedad: 12 años, 8 meses
Puntos: 1
Respuesta: falla en leer los mp

Ahora tengo el archivo leer.php
que es el que se va encargar de mandar llamar de la base de datos el mensaje que se envio
pero solo me aparece esto

De: SantosMc03
Fecha: SatSat/AugAug/PMPM, 5:47 pm
Asunto: hola

Mensaje:

PHP Error Message

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/a9500782/public_html/leer.php on line 23

Free Web Hosting

El codigo es el siguiente:
Código PHP:
Ver original
  1. <?php
  2. # Incluimos la configuracion
  3. include('config.php');
  4. $c = mysql_connect('host', 'root', 'pass');
  5. mysql_select_db('database');
  6. $id = $_GET['id'];
  7. $sql = "SELECT * FROM mensaje WHERE para='".$_SESSION['s_username']."' and ID='".$id."'";
  8. $res = mysql_query($sql) or die(mysql_error());
  9. $row = mysql_fetch_assoc($res);
  10. ?>
  11. <html>
  12. <head>Yourspace</head>
  13. <body>
  14. Menu: <a href="listar.php">Ver mensajes</a> | <a href="crear.php">Crear mensajes</a> | <a href="cerrar.php">Cerrar sesion</a><br /><br />
  15. <strong>De:</strong> <?=$row['de']?><br />
  16. <strong>Fecha:</strong> <?=$row['fecha']?><br />
  17. <strong>Asunto:</strong> <?=$row['asunto']?><br /><br />
  18. <strong>Mensaje:</strong><br />
  19. <?php
  20. # Avisamos que ya lo leimos
  21. if($row['leido'] != "si")
  22. {
  23.     mysql_query("UPDATE mensaje SET leido='si'",$link) or die(mysql_error());
  24. }
  25. $row['texto']
  26. ?>
  27. </body>
  28. </html>