Ver Mensaje Individual
  #1 (permalink)  
Antiguo 11/12/2011, 10:37
endgel
 
Fecha de Ingreso: diciembre-2010
Mensajes: 26
Antigüedad: 13 años, 4 meses
Puntos: 2
problema con insert en php

buenas tardes amigo, vuelvo por aca, por que tengo un codigo para insertar, pero no me esta insertando los campos, algo malo tengo y no se que es, he alternado opciones y aun sigo sin insertar..

mi archivo de conexion llamado acc.php que se encuentra dentro de una carpeta llamada Connections
Código PHP:
<?php

$hostname_acc 
"localhost";
$database_acc "sistema";
$username_acc "root";
$password_acc "root";
$acc mysql_pconnect($hostname_acc$username_acc$password_acc) or trigger_error(mysql_error(),E_USER_ERROR); 
?>
y el formulario llamado form_agregar_usuario.php se encuentra en otra carpeta llamada mod_admin

Código HTML:
<style type="text/css">
<!--
body,td,th {
	color: #003399;
}
body {
	background-color: #CCFFFF;
}
-->
</style>

  </p>
  <form name="agregar_usuario" method="post" action="agregar_usuario.php">

<table width="466" border="0">
  <tr>
    <th width="123" scope="row"><div align="justify">Cedula</div>
      <label></label></th>
    <td width="333"><label>
      <input type="text" name="cedula" />
    </label>
      <label></label></td>
  </tr>
  <tr>
    <th scope="row"><div align="justify">primer nombre</div>
      <label></label></th>
    <td><label>
      <input type="text" name="primernombre">
    </label></td>
  </tr>
  <tr>
    <th scope="row"><label>
      <div align="justify">segundo nombre </div>
      </label></th>
    <td><input type="text" name="segundonombre"></td>
  </tr>
  <tr>
    <th scope="row"><label>
      <div align="justify">primer apellido </div>
      </label></th>
    <td><input type="text" name="primerapellido"></td>
  </tr>
  <tr>
    <th scope="row"><label>
      <div align="justify">segundo apellido</div>
      </label></th>
    <td><input type="text" name="segundoapellido"></td>
  </tr>
  <tr>
    <th scope="row"><label>
      <div align="justify">telefono</div>
      </label></th>
    <td><input type="text" name="telefono"></td>
  </tr>
  <tr>
    <th scope="row"><div align="justify">email</div></th>
    <td><input name="email" type="text" id="email"></td>
  </tr>
  <tr>
    <th scope="row"><label>
      <div align="justify">sexo </div>
      </label></th>
    <td><input name="sexo" type="text" id="sexo" /></td>
  </tr>
  <tr>
    <th scope="row"><div align="justify">direccion</div> <label></label></th>
    <td><label>
      <textarea name="direccion" wrap="off"></textarea>
    </label></td>
  </tr>
  <tr>
    <th scope="row"><input name="reset" type="submit" id="reset" value="limpiar" /></th>
    <td><input name="Submit" type="submit" id="Submit" value="Registrar" /></td>
  </tr>
</table>
<p>
  <label><br />
   <br />
  </label>
</p>
  </form> 
mi archivo php para procesara la info llamado agregar_usuario.php que tambien esta dentro de la carpeta mod_admin

Código PHP:
<?php
   
require_once("../Connections/acc.php"); 

 if (!isset(
$_SESSION)) {
  
session_start();

$Cedula=$_POST['cedula'];
$PrimerNombre=$_POST['primernombre'];
$SegundoNombre=$_POST['segundonombre'];
$PrimerApellido=$_POST['primerapellido'];
$SegundoApellido=$_POST['segundoapellido'];
$telefono=$_POST['telefono'];
$email=$_POST['email'];
$sexo=$_POST['sexo'];
$direccion=$_POST['direccion'];
 
$Sql="insert into datos_personales values ('$Cedula','$PrimerNombre','$SegundoNombre','$PrimerApellido','$SegundoApellido','$telefono','$email','$sexo','$direccion')";     
   
   
mysql_query($Sql,$acc );
}

 
?>

agradeciendo su ayuda prestada.. y sus sugerencias. mis saludos y respetos