Jump to content

(SOLUCIONADO) Provincias


melose

Recommended Posts

Hola, estoy tratando de meter las provincias en MSQ y me sale este error

#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 'Coruna’, ‘ES-C’, 0, 1), (314, 6, 9, ‘Alava’, ‘ES-VI’, 0, 1), (315,' at line 2

 

Pero he copiado una lista y he seguido las instrucciones de un videotutorial y no sé qué estoy haciendo mal

 

Uso el prestashop 1.5.2 y el listado que tengo es éste

 

 

25]

 

 

INSERT INTO `ps_state` (`id_state`, `id_country`, `id_zone`, `name`, `iso_code`, `tax_behavior`, `active`) VALUES

(313, 6, 9, ‘A Coruna’, ‘ES-C’, 0, 1),

(314, 6, 9, ‘Alava’, ‘ES-VI’, 0, 1),

(315, 6, 9, ‘Albacete’, ‘ES-AB’, 0, 1),

(316, 6, 9, ‘Alicante’, ‘ES-A’, 0, 1),

(317, 6, 9, ‘Almeria’, ‘ES-AL’, 0, 1),

(318, 6, 9, ‘Asturias’, ‘ES-O’, 0, 1),

(319, 6, 9, ‘Avila’, ‘ES-AV’, 0, 1),

(320, 6, 9, ‘Badajoz’, ‘ES-BA’, 0, 1),

(321, 6, 9, ‘Baleares’, ‘ES-PM’, 0, 1),

(322, 6, 9, ‘Barcelona’, ‘ES-B’, 0, 1),

(323, 6, 9, ‘Burgos’, ‘ES-BU’, 0, 1),

(324, 6, 9, ‘Caceres’, ‘ES-CC’, 0, 1),

(325, 6, 9, ‘Cadiz’, ‘ES-CA’, 0, 1),

(326, 6, 9, ‘Cantabria’, ‘ES-S’, 0, 1),

(327, 6, 9, ‘Castellon’, ‘ES-CS’, 0, 1),

(328, 6, 9, ‘Ceuta’, ‘ES-CE’, 0, 1),

(329, 6, 9, ‘Ciudad Real’, ‘ES-CR’, 0, 1),

(330, 6, 9, ‘Cordoba’, ‘ES-CO’, 0, 1),

(331, 6, 9, ‘Cuenca’, ‘ES-CU’, 0, 1),

(332, 6, 9, ‘Girona’, ‘ES-GI’, 0, 1),

(333, 6, 9, ‘Granada’, ‘ES-GR’, 0, 1),

(334, 6, 9, ‘Guadalajara’, ‘ES-GU’, 0, 1),

(335, 6, 9, ‘Guipuzcoa’, ‘ES-SS’, 0, 1),

(336, 6, 9, ‘Huelva’, ‘ES-H’, 0, 1),

(337, 6, 9, ‘Huesca’, ‘ES-HU’, 0, 1),

(338, 6, 9, ‘Jaen’, ‘ES-J’, 0, 1),

(339, 6, 9, ‘La Rioja’, ‘ES-LO’, 0, 1),

(340, 6, 9, ‘Las Palmas’, ‘ES-GC’, 0, 1),

(341, 6, 9, ‘Leon’, ‘ES-LE’, 0, 1),

(342, 6, 9, ‘Lleida’, ‘ES-L’, 0, 1),

(343, 6, 9, ‘Lugo’, ‘ES-LU’, 0, 1),

(344, 6, 9, ‘Madrid’, ‘ES-M’, 0, 1),

(345, 6, 9, ‘Malaga’, ‘ES-MA’, 0, 1),

(346, 6, 9, ‘Melilla’, ‘ES-ML’, 0, 1),

(347, 6, 9, ‘Murcia’, ‘ES-MU’, 0, 1),

(348, 6, 9, ‘Navarra’, ‘ES-NA’, 0, 1),

(349, 6, 9, ‘Ourense’, ‘ES-OR’, 0, 1),

(350, 6, 9, ‘Palencia’, ‘ES-P’, 0, 1),

(351, 6, 9, ‘Pontevedra’, ‘ES-PO’, 0, 1),

(352, 6, 9, ‘Salamanca’, ‘ES-SA’, 0, 1),

(353, 6, 9, ‘Santa Cruz de Tenerife’, ‘ES-TF’, 0, 1),

(354, 6, 9, ‘Segovia’, ‘ES-SG’, 0, 1),

(355, 6, 9, ‘Sevilla’, ‘ES-SE’, 0, 1),

(356, 6, 9, ‘Soria’, ‘ES-SO’, 0, 1),

(357, 6, 9, ‘Tarragona’, ‘ES-T’, 0, 1),

(358, 6, 9, ‘Teruel’, ‘ES-TE’, 0, 1),

(359, 6, 9, ‘Toledo’, ‘ES-TO’, 0, 1),

(360, 6, 9, ‘Valencia’, ‘ES-V’, 0, 1),

(361, 6, 9, ‘Valladolid’, ‘ES-VA’, 0, 1),

(362, 6, 9, ‘Vizcaya’, ‘ES-BI’, 0, 1),

(363, 6, 9, ‘Zamora’, ‘ES-ZA’, 0, 1),

(364, 6, 9, ‘Zaragoza’, ‘ES-Z’, 0, 1);
Edited by melose (see edit history)
Link to comment
Share on other sites

Bueno pues ahora esta mas que claro que ya tienes agregadas algunas provincias y estas intentando duplicar el primary key, rebisa tu tabla ps_states y fijate en el ultimo registro cual es el ultimo id que esta insertado y necesitaras recorrer todos los de tu lista a partir de ese, recuerda que no puede haber duplicados en esa tabla, saludos.

Edited by sQs (see edit history)
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...