Ver Mensaje Individual
  #17 (permalink)  
Antiguo 06/08/2011, 15:23
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

lo puse asi:

Código PHP:
Ver original
  1. <?php
  2. # Incluimos la configuracion
  3. include('config.php');
  4. if($_SESSION['logueado'] != "SI"){
  5. function form(){
  6. global $link;
  7. # Buscamos los mensajes privados
  8. $sql = "SELECT * FROM mensaje WHERE para='".$_SESSION['s_username']."'";
  9. $res = mysql_query($sql, $link) or die(mysql_error());
  10. }
  11. }
  12. ?>
  13. Menu: <a href="listar.php">Ver mensajes</a> | <a href="crear.php">Crear mensajes</a> | <a href="cerrar.php">Cerrar sesion</a><br /><br />
  14.   <table width="800" border="0" align="center" cellpadding="1" cellspacing="1">
  15.     <tr>
  16.       <td width="53" align="center" valign="top"><strong>ID</strong></td>
  17.       <td width="426" align="center" valign="top"><strong>Asunto</strong></td>
  18.       <td width="321" align="center" valign="top"><strong>De</strong></td>
  19.       <td width="321" align="center" valign="top"><strong>Fecha</strong></td>
  20.     </tr>
  21.     <?php
  22.     form();
  23.     echo $sql;
  24.     $i = 0;
  25.     while($show = mysql_fetch_assoc($res)) {
  26.     mysql_free_result($res);?>
  27.     <tr bgcolor="<?php if($show['leido'] == "si") { echo "#FFE8E8"; } else { if($i%2==0) { echo "#FFE7CE"; } else { echo "#FFCAB0"; } } ?>">
  28.       <td align="center" valign="top"><?=$show['ID']?></td>
  29.       <td align="center" valign="top"><a href="leer.php?id=<?=$show['ID']?>"><?=$show['asunto']?></a></td>
  30.       <td align="center" valign="top"><?=$show['de']?></td>
  31.       <td align="center" valign="top"><?=$show['fecha']?></td>
  32.     </tr>
  33. <?php $i++;
  34. }?>
  35. </table>

y ahora me sale Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/a9500782/public_html/listar.php on line 10