Ver Mensaje Individual
  #1 (permalink)  
Antiguo 23/06/2012, 09:11
alejandromaringomez
 
Fecha de Ingreso: abril-2010
Mensajes: 267
Antigüedad: 14 años, 1 mes
Puntos: 1
Qusiera mostrar datos de una tabla en MSQL

Hola , soy un principiante en PHP y voy poco a poco , me gustaría que me dieran un code..
les comento.. Yo tengo una tabla llamada Usuarios en MSQL con varias celdas , en una el id del user , en la otra la pas , y en otra la fecha que caduca la cuenta , me gustaría poner un code en PHP , que me mostrase el contenido de la xcelda llamada fecha , para que pudieran ver la fecha que caduca su cuenta , el code es el siguiente , trata de una pagina login..
CODE:
<?php

session_start();
include_once "conexion.php";

function verificar_login($user,$password,&$result)
{
$sql = "SELECT * FROM usuarios WHERE usuario = '$user' and password = '$password'";
$rec = mysql_query($sql);
$count = 0;
while($row = mysql_fetch_object($rec))
{
$count++;
$result = $row;
}
if($count == 1)
{
return 1;
}
else
{
return 0;
}
}
if(!isset($_SESSION['userid']))
{
if(isset($_POST['login']))
{
if(verificar_login($_POST['user'],$_POST['password'],$result) == 1)
{
$_SESSION['userid'] = $result->idusuario;
$_SESSION['username'] = $result->usuario;
$_SESSION['name'] = $result->nombres;
$_SESSION['type'] = $result->type;
header("location:index.php");
}
//else
//{
// echo '<img src="error.png" style="margin-top:-5%;margin-left:50%;">';
//}
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" class="">
<head>
<title>Metokes.com - La mejor web fan sobre BoomBang ! - Login VIP</title>
<META HTTP-EQUIV=Refresh CONTENT="0; URL=index.php">
</head>
<body>
<a href="index.php">Inicia sesión como VIP para poder ver esta página</a>
</body>
</html>

<?
}
else
{
echo '
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Metokes.com - La mejor Web Fan sobre BoomBang ! - VIP</title>
<link rel="stylesheet" type="text/css" href="../css/style-vip.css" />
</head>
<body>
<!-- Begin Wrapper -->
<div id="wrapper">
<!-- Begin Header -->
<div id="header"></div>
<!-- End Header -->
<!-- Begin Naviagtion -->
<div id="navigation"><a href="index.php">Inicio</a><a href="juego.php">Juego</a><a href="musica.php">Música</a></div>
<!-- End Naviagtion -->
<!-- Begin Opciones -->
<div id="opciones"><p>Hola ' . $_SESSION['username'] . ' ! , <a href="detalles-cuenta.php">DETALLES DE LA CUENTA</a> , <a href="logout.php">DESCONECTAR</a></p></div>
<!-- End Opciones -->
<!-- Begin Content -->
<div id="content"><h1>Detalles de la cuenta de ' . $_SESSION['username'] . ' </h1><br>
<p>
<table border="0">
<tr>
<td>Fecha de Caducación</td>
<td>-</td>
</tr>
<tr>
<td colspan="2" style="color:red;">*AVISO: Si quieres renovar la cuenta , cuesta <strong>1 BBox</strong> , dile el usuario , cuanto tiempo quieres renovar a el keko METOKES en BoomBang Esp , RENUEVA ANTES DE QUE SE ACABE EL TIEMPO !</td>
</table>
</p></div>
<!-- End Content -->
<!-- Begin Footer -->
<div id="footer">© metokes.com/login 2012-13</div>
<!-- End Footer -->
</div>
<!-- End Wrapper -->
</body>
</html>';
}
?>



_______________
GRACIAS! :D