Ver Mensaje Individual
  #1 (permalink)  
Antiguo 27/04/2010, 15:56
DiegoRivera2010
 
Fecha de Ingreso: abril-2010
Mensajes: 50
Antigüedad: 14 años
Puntos: 0
Exclamación Ayudaaaaa Registro y Como MOstrar los Datos

hola mi duda es q en mi pagina uno debe registrarse y pues quiero que al registrarme al dal click en guardar registro el me muestre los datos que almacene no como me muestra ahora que me salen todos los registros que ay en la base de datos

Codigo PHP para ingresar el registro a la base de datos
Código PHP:
<?php require_once('Connections/validacion.php'); ?>
<?php
function GetSQLValueString($theValue$theType$theDefinedValue ""$theNotDefinedValue ""
{
  
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;

  switch (
$theType) {
    case 
"text":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;    
    case 
"long":
    case 
"int":
      
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case 
"double":
      
$theValue = ($theValue != "") ? "'" doubleval($theValue) . "'" "NULL";
      break;
    case 
"date":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;
    case 
"defined":
      
$theValue = ($theValue != "") ? $theDefinedValue $theNotDefinedValue;
      break;
  }
  return 
$theValue;
}

$editFormAction $_SERVER['PHP_SELF'];
if (isset(
$_SERVER['QUERY_STRING'])) {
  
$editFormAction .= "?" htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset(
$_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
  
$insertSQL sprintf("INSERT INTO primera (nombre, sexo, cedula, direccion, barrio, tel_residencia, tel_celular, correo, dia, mes, año, estado_civil, mascota, tipo_mascota, carro, marca_carro, moto, marca_moto, ocupacion, lug_de_trabajo, tel_trabajo, nombre_pareja, dia_pareja, mes_pareja, año_pareja, num_perso_vive, num_hijos, nombre_hijo1, dia_hijo1, mes_hijo1, año_hijo1, nombre_hijo2, dia_hijo2, mes_hijo2, año_hijo2) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
                       
GetSQLValueString($_POST['nombre'], "text"),
                       
GetSQLValueString($_POST['sexo'], "text"),
                       
GetSQLValueString($_POST['cedula'], "int"),
                       
GetSQLValueString($_POST['direccion'], "text"),
                       
GetSQLValueString($_POST['barrio'], "text"),
                       
GetSQLValueString($_POST['tel_residencia'], "int"),
                       
GetSQLValueString($_POST['tel_celular'], "text"),
                       
GetSQLValueString($_POST['correo'], "text"),
                       
GetSQLValueString($_POST['dia'], "int"),
                       
GetSQLValueString($_POST['mes'], "int"),
                       
GetSQLValueString($_POST['ao'], "int"),
                       
GetSQLValueString($_POST['estado_civil'], "text"),
                       
GetSQLValueString($_POST['mascota'], "text"),
                       
GetSQLValueString($_POST['tipo_mascota'], "text"),
                       
GetSQLValueString($_POST['carro'], "text"),
                       
GetSQLValueString($_POST['marca_carro'], "text"),
                       
GetSQLValueString($_POST['moto'], "text"),
                       
GetSQLValueString($_POST['marca_moto'], "text"),
                       
GetSQLValueString($_POST['ocupacion'], "text"),
                       
GetSQLValueString($_POST['lug_de_trabajo'], "text"),
                       
GetSQLValueString($_POST['tel_trabajo'], "int"),
                       
GetSQLValueString($_POST['nombre_pareja'], "text"),
                       
GetSQLValueString($_POST['dia_pareja'], "int"),
                       
GetSQLValueString($_POST['mes_pareja'], "int"),
                       
GetSQLValueString($_POST['ao_pareja'], "int"),
                       
GetSQLValueString($_POST['num_perso_vive'], "int"),
                       
GetSQLValueString($_POST['num_hijos'], "int"),
                       
GetSQLValueString($_POST['nombre_hijo1'], "text"),
                       
GetSQLValueString($_POST['dia_hijo1'], "int"),
                       
GetSQLValueString($_POST['mes_hijo1'], "int"),
                       
GetSQLValueString($_POST['ao_hijo1'], "int"),
                       
GetSQLValueString($_POST['nombre_hijo2'], "text"),
                       
GetSQLValueString($_POST['dia_hijo2'], "int"),
                       
GetSQLValueString($_POST['mes_hijo2'], "int"),
                       
GetSQLValueString($_POST['ao_hijo2'], "int"));

  
mysql_select_db($database_validacion$validacion);
  
$Result1 mysql_query($insertSQL$validacion) or die(mysql_error());

  
$insertGoTo "otrapunt.php";
  if (isset(
$_SERVER['QUERY_STRING'])) {
    
$insertGoTo .= (strpos($insertGoTo'?')) ? "&" "?";
    
$insertGoTo .= $_SERVER['QUERY_STRING'];
  }
  
header(sprintf("Location: %s"$insertGoTo));
}
?>
y aca para mostrar los datos recien ingresado a la base de dato pero no es lo q quiero
Código PHP:
<?php

$link 
mysql_connect("localhost""root");

mysql_select_db("supermercado"$link);

$result mysql_query("SELECT nombre, sexo, cedula, direccion, barrio, tel_residencia, tel_celular, correo, dia, mes, año, estado_civil, mascota, tipo_mascota, carro, marca_carro, moto, marca_moto, ocupacion, lug_de_trabajo, tel_trabajo, nombre_pareja, dia_pareja, mes_pareja, año_pareja, num_perso_vive, num_hijos, nombre_hijo1, dia_hijo1, mes_hijo1, año_hijo1, nombre_hijo2, dia_hijo2, mes_hijo2, año_hijo2 FROM primera"$link);

if (
$row mysql_fetch_array($result)){

echo 
"<table border = '1'> \n";

echo 
"<tr> \n";

echo 
"<td><b>Nombre</b></td> \n";

echo 
"<td><b>Sexo</b></td> \n";
echo 
"<td><b>Cedula </b></td> \n";

echo 
"<td><b>Direccion</b></td> \n";
echo 
"<td><b>Barrio</b></td> \n";

echo 
"<td><b>Telefono Residencia</b></td> \n";
echo 
"<td><b>Telefono Celular</b></td> \n";

echo 
"<td><b>Correo</b></td> \n";
echo 
"<td><b>Dia Nacimiento</b></td> \n";

echo 
"<td><b>Mes Nacimiento</b></td> \n";
echo 
"<td><b>Año Nacimiento</b></td> \n";

echo 
"<td><b>Estado Civil</b></td> \n";
echo 
"<td><b>Mascota</b></td> \n";

echo 
"<td><b>Tipo Mascota</b></td> \n";

echo 
"<td><b>Carro</b></td> \n";

echo 
"<td><b>Tipo Carro</b></td> \n";
echo 
"<td><b>Moto</b></td> \n";

echo 
"<td><b>Tipo Moto</b></td> \n";
echo 
"<td><b>Ocupacion</b></td> \n";

echo 
"<td><b>Lugar De Trabajo</b></td> \n";
echo 
"<td><b>Telefono De Trabajo</b></td> \n";

echo 
"<td><b>Nombre Conyugè</b></td> \n";
echo 
"<td><b>Dia Nacimiento Conyugè</b></td> \n";

echo 
"<td><b>Mes Nacimiento Conyugè</b></td> \n";
echo 
"<td><b>Año Nacimiento Conyugè</b></td> \n";

echo 
"<td><b>Numero De Personas Con las Que Ud Vive</b></td> \n";
echo 
"<td><b>Numero De Hijos</b></td> \n";

echo 
"<td><b>nombre_hijo1</b></td> \n";
echo 
"<td><b>Dia Nacimiento Hijo1</b></td> \n";

echo 
"<td><b>Mes Nacimiento Hijo1</b></td> \n";
echo 
"<td><b>Año Nacimiento Hijo1</b></td> \n";

echo 
"<td><b>nombre_hijo2</b></td> \n";
echo 
"<td><b>Dia Nacimiento Hijo2</b></td> \n";

echo 
"<td><b>Mes Nacimiento Hijo2</b></td> \n";
echo 
"<td><b>Año Nacimiento Hijo2</b></td> \n";



echo 
"</tr> \n";

do {

echo 
"<tr> \n";

echo 
"<td>".$row["nombre"]."</td> \n";

echo 
"<td>".$row["sexo"]."</td>\n";
echo 
"<td>".$row["cedula"]."</td> \n";
echo 
"<td>".$row["direccion"]."</td>\n";

echo 
"<td>".$row["barrio"]."</td>\n";
echo 
"<td>".$row["tel_residencia"]."</td> \n";

echo 
"<td>".$row["tel_celular"]."</td>\n";
echo 
"<td>".$row["correo"]."</td> \n";

echo 
"<td>".$row["dia"]."</td>\n";
echo 
"<td>".$row["mes"]."</td> \n";

echo 
"<td>".$row["año"]."</td>\n";
echo 
"<td>".$row["estado_civil"]."</td> \n";

echo 
"<td>".$row["mascota"]."</td>\n";
echo 
"<td>".$row["tipo_mascota"]."</td> \n";

echo 
"<td>".$row["carro"]."</td>\n";
echo 
"<td>".$row["marca_carro"]."</td> \n";

echo 
"<td>".$row["moto"]."</td>\n";
echo 
"<td>".$row["marca_moto"]."</td> \n";

echo 
"<td>".$row["ocupacion"]."</td>\n";
echo 
"<td>".$row["lug_de_trabajo"]."</td> \n";

echo 
"<td>".$row["tel_trabajo"]."</td>\n";
echo 
"<td>".$row["nombre_pareja"]."</td> \n";

echo 
"<td>".$row["dia_pareja"]."</td>\n";
echo 
"<td>".$row["mes_pareja"]."</td> \n";

echo 
"<td>".$row["año_pareja"]."</td>\n";
echo 
"<td>".$row["num_perso_vive"]."</td> \n";

echo 
"<td>".$row["num_hijos"]."</td>\n";
echo 
"<td>".$row["nombre_hijo1"]."</td> \n";

echo 
"<td>".$row["dia_hijo1"]."</td>\n";
echo 
"<td>".$row["mes_hijo1"]."</td> \n";

echo 
"<td>".$row["año_hijo1"]."</td>\n";
echo 
"<td>".$row["nombre_hijo2"]."</td> \n";
echo 
"<td>".$row["dia_hijo2"]."</td>\n";
echo 
"<td>".$row["mes_hijo2"]."</td> \n";

echo 
"<td>".$row["año_hijo2"]."</td>\n";

echo 
"</tr> \n";

} while (
$row mysql_fetch_array($result));

echo 
"</table> \n";

} else {

echo 
"¡ La base de datos está vacia !";

}

?>
De ante mano MUCHAS GRACIAS por las respuestaas

Última edición por DiegoRivera2010; 27/04/2010 a las 16:01