Ver Mensaje Individual
  #1 (permalink)  
Antiguo 07/11/2009, 07:32
Avatar de neodani
neodani
 
Fecha de Ingreso: marzo-2007
Mensajes: 1.811
Antigüedad: 17 años, 2 meses
Puntos: 20
Cómo validar los datos para evitar estos errores

Buenas,

Estoy intentando hacer un insert pero me devuelve el siguiente error

DISEÑO TABLA
Código:
CREATE TABLE pagos_tpv (
	id int(5) NOT NULL auto_increment,
	Ds_Date date NOT NULL,
	Ds_Hour time NOT NULL,
	Ds_SecurePayment int(1) NOT NULL,
	Ds_Card_Country int(3),
	Ds_Amount int(12) NOT NULL,
	Ds_Currency int(4) NOT NULL,
	Ds_Order int(12) NOT NULL,
	Ds_MerchantCode int(9) NOT NULL,
	Ds_Terminal int(3) NOT NULL,
	Ds_Signature varchar(40) NOT NULL,
	Ds_Response int(4),
	Ds_MerchantData varchar(1024),
	Ds_TransactionType varchar(1) NOT NULL,
	Ds_ConsumerLanguage int(3) NOT NULL,
	Ds_ErrorCode varchar(7),
	Ds_AuthorisationCode varchar(6) NOT NULL default '-1',
	PRIMARY KEY(id)
);

CONSULTA
Código:
 
INSERT INTO pagos_tpv( 'Ds_Date', 'Ds_Hour', 'Ds_SecurePayment', 'Ds_Card_Country', 'Ds_Amount', 'Ds_Currency', 'Ds_Order', 'Ds_MerchantCode', 'Ds_Terminal', 'Ds_Signature', 'Ds_Response', 'Ds_MerchantData', 'Ds_TransactionType', 'Ds_ConsumerLanguage', 'Ds_ErrorCode', 'Ds_AuthorisationCode' )
VALUES (
'06/11/2009', '23:19', 0, 724, 10000, 978, 091106231850, 81836008, 001, '8FBE53D9DF26EFAE6741FD1DE5DCE31A4136BEF2', 0913, '', 0, 1, 'SIS0051', '-1'
)
ERROR
Código:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''Ds_Date','Ds_Hour','Ds_SecurePayment','Ds_Card_Country','Ds_Amount','Ds_Currenc' at line 1

Todos los campos que son INT no hace falta que esten con comillas simples en la linea del value no?
Y el resto de campos fecha, hora y VARCHAR, tienen comillas simples

Pues no se porque peta, veis algun error que se me escape? cómo soléis validarlo vosotros? también os pasa?

Muchas gracias de antemano!