Ver Mensaje Individual
  #5 (permalink)  
Antiguo 27/05/2013, 08:27
nenezapata
 
Fecha de Ingreso: mayo-2013
Mensajes: 2
Antigüedad: 10 años, 11 meses
Puntos: 0
Respuesta: Clase ManiDB fácil manipulación de datos para novatos!

Buenos dias , yo estoy usando la clase que publicaron, no le he hecho ninguna modificación, y cuando intento insertar me muestra varios errores

Notice: Undefined index: TextNombre in C:\wamp\www\obando\htdocs\Pacientes.php on line 24

Call Stack
# Time Memory Function Location
1 0.0004 681208 {main}( ) ..\Pacientes.php:0
2 0.0004 681208 Insert( ) ..\Pacientes.php:75

( ! ) Notice: Undefined index: TextApellido in C:\wamp\www\obando\htdocs\Pacientes.php on line 24
Call Stack
# Time Memory Function Location
1 0.0004 681208 {main}( ) ..\Pacientes.php:0
2 0.0004 681208 Insert( ) ..\Pacientes.php:75

( ! ) Notice: Undefined index: TextCedula in C:\wamp\www\obando\htdocs\Pacientes.php on line 24
Call Stack
# Time Memory Function Location
1 0.0004 681208 {main}( ) ..\Pacientes.php:0
2 0.0004 681208 Insert( ) ..\Pacientes.php:75

( ! ) Notice: Undefined index: TextCiudad in C:\wamp\www\obando\htdocs\Pacientes.php on line 24
Call Stack
# Time Memory Function Location
1 0.0004 681208 {main}( ) ..\Pacientes.php:0
2 0.0004 681208 Insert( ) ..\Pacientes.php:75

( ! ) Notice: Undefined index: TextTel in C:\wamp\www\obando\htdocs\Pacientes.php on line 24
Call Stack
# Time Memory Function Location
1 0.0004 681208 {main}( ) ..\Pacientes.php:0
2 0.0004 681208 Insert( ) ..\Pacientes.php:75
Hay un error en la consulta: Column count doesn't match value count at row 1


eeso es lo que me muestra y no entiendo muy bien por que soy nuevo en php,,mi codigo es este:



Código HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin título</title>

[PHP]<?php 
function Insert(){
require('Manidb.class.php'); 

//El constructor lo iniciamos con el host, usuario, password y base de datos. 
$var = new Manidb('localhost', ,, 'odontologia');   aca si tengo contraseña y pass si  no que por seguridad no las pongo

//Hacemos la consulta y retorna un arreglo, en donde guarda todos los registros separados por comas. 

$arreglo = $var->consulta("SELECT * FROM pacientes"); 

//Ahora podemos imprimir el arreglo y escribirá toda la consutla por ejemplo 1, edgar, [email protected]. 

//Para separarlo usamos el siguiente método. 
$arreglo = $var->separa($arreglo); 

//También podemos insertar estos. 
$insertar = array("'"+$_POST["TextNombre"]+"', '"+$_POST["TextApellido"]+"','"+$_POST["TextCedula"]+"','"+$_POST["TextCiudad"]+"','"+$Telefono= $_POST["TextTel"]+"'"); 
$var->insertar($insertar, "pacientes"); 
}
?>[/PHP]
</head>

<body>
<table width="600" border="0" align="center">
  <tr>
    <td align="center" valign="middle">
      <p>&nbsp;</p>
      <table width="395" border="0">
        <tr>
          <td width="75">Nombre</td>
          <td width="310" align="center" valign="middle"><label for="TextNombre2"></label>
            <input name="TextNombre" type="text" id="TextNombre2" size="50" /></td>
        </tr>
        <tr>
          <td>Apellidos</td>
          <td align="center" valign="middle"><label for="TextApellido"></label>
            <input name="TextApellido" type="text" id="TextApellido" size="50" /></td>
        </tr>
        <tr>
          <td>Cedula</td>
          <td align="center" valign="middle"><label for="TextApellido"></label>
            <input name="TextCedula" type="text" id="TextApellido" size="50" /></td>
        </tr>
        <tr>
          <td>Ciudad</td>
          <td align="center" valign="middle"><label for="TextCiudad"></label>
            <input name="TextCiudad" type="text" id="TextCiudad" size="50" /></td>
        </tr>
        <tr>
          <td>Telefono</td>
          <td align="center" valign="middle"><label for="TextTel"></label>
            <input name="TextTel" type="text" id="TextTel" size="50" /></td>
        </tr>
      </table>
      <p>
        <input type="submit" name="BtnIngresarP" id="BtnIngresarP" value="Ingresar Paciente" onclick="<?php Insert()?>" />
      </p>
      <p>&nbsp;</p></td>
  </tr>
</table>
</body>
</html>