Ver Mensaje Individual
  #2 (permalink)  
Antiguo 09/04/2012, 08:57
Avatar de CesarHC
CesarHC
 
Fecha de Ingreso: junio-2011
Ubicación: localhost
Mensajes: 566
Antigüedad: 12 años, 11 meses
Puntos: 56
Respuesta: error en codigo

El parentesis esta mal puesto y te sobra un punto y coma a ver prueba asi:

Código PHP:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>Documento sin título</title>
  6. </head>
  7. <?php
  8. // datos para la conexion a mysql
  9. $tabla = "tabla_deudas";
  10. define('DB_SERVER','localhost');
  11. define('DB_NAME','usuario_basededatos');
  12. define('DB_USER','usuario_usuario_de_la_base_de_datos');
  13. define('DB_PASS','password');
  14. $con = mysql_connect(DB_SERVER,DB_USER,DB_PASS);
  15. mysql_select_db(DB_NAME,$con)or die('No se ha podido conectar');
  16.  
  17.  
  18. $sql = "select CODIGO, Año, Mes, Total, Pagado, Fecha from tb_deudas where
  19. CODIGO in
  20. (select codigo from tb_nickname where nick = ".$_SESSION['username'].")
  21. order by CODIGO, Año DESC, Mes DESC";
  22.  
  23. //   echo $sql;
  24.  
  25. //$sql = "SELECT password, fullname, active FROM ".$mysql_table." WHERE username = '".mysql_real_escape_string($_POST['username'])."'";
  26.        $result = mysql_query($sql,$db);
  27.    if ($data=mysql_fetch_array($result))  
  28.        {                  
  29.      echo $data['mes']." ".$data['Total']." ".$data['Pagado'];
  30.   }                        
  31.   mysql_close($db);
  32. ?>
  33.  
  34. <body>
  35. </body>
  36. </html>

PD: Usa el highlight para el codigo y para comentarios usa //.
__________________
Solo la práctica no te traicionara ¡¡¡¡¡¡

Seguir el camino tu debes PHP The Right Way.