I have a PHP form, I am telling you to create the following table:
$sql=" CREATE TABLE auxtmp (
n_linea serial,
c_concepto_mov char(2) not null,
c_almacen_origen smallint default 0 not null,
c_almacen_destino smallint default 0 not null,
f_movimiento date not null,
ca_movimiento decimal(19,3) not null,
c_barra char(18) not null,
pr_compra decimal(10,2) default 0 not null,
pr_venta decimal(10,2) default 0 not null,
nit_prov decimal(16,0) default 0 not null ,
cs_factura char(20) not null ,
foreign key (c_concepto_mov) references traslados(cod_trasl)
constraint noexiste_concepto$auxtmp,
foreign key (c_almacen_origen) references m_almacenes(c_almacen)
constraint noexiste_almacen_origen$auxtmp,
foreign key (c_almacen_destino) references m_almacenes(c_almacen)
constraint noexiste_almacen_destino$auxtmp,
foreign key (c_barra) references read_plu(cod_barra)
constraint noexiste_Producto");
The cs_factura
field is type char
This form is to load a plan of an inventory, which has the following structure:
Concept | Alm_Origen | Alm_Destino | Fecha_Mov | Quantity | Cod_Barra | Price_Shopping Price_Sale | Nit_Provider | Num_Factura
When I try to load a plan and the invoice number contains letters, I do not upload the information.
This is one of the INSERT that is made in the code:
$sql="INSERT INTO $auxtmp $campos)VALUES($mireg) ";
Printing the SQL, this is the information I get:
INSERT INTO auxtmp (c_concepto_mov, c_almacen_origen, c_almacen_destino,
f_movimiento, ca_movimiento, c_barra ,pr_compra,
pr_venta, nit_prov, cs_factura )
VALUES('EC','3' ,'3' ,'18/05/2015' ,'104' ,'7703596011872',
'24403' ,'24403' ,'165' ,'86ED3' )