
25/04/2010, 13:16
|
| | Fecha de Ingreso: abril-2010
Mensajes: 13
Antigüedad: 14 años, 10 meses Puntos: 0 | |
Respuesta: ejmplo php y postgresql este es el codigo de insercion donde no quiere reconosre (pg_querry)
Warning: pg_query() [function.pg-query]: Query failed: ERROR: INSERT has more expressions than target columns in C:\wamp\www\clinica\insertar.php on line 13
<?php
include('coneccion.php');
$nom_est=$_POST['nom_est'];
$apell_est=$_POST['apell_est'];
$max_id=pg_query("select max(id_est)from estudiante");
$id_maximo=1;
if($row=pg_fetch_array($max_id))
{
$id_maximo=$row[0]+1;
}
$sql="INSERT INTO estudiante VALUES($id_maximo,'$nom_est','$apell_est')";
pg_query($sql); |