SA-MP Forums Archive
MySQL Importing Problem??PLS HELP - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MySQL Importing Problem??PLS HELP (/showthread.php?tid=605908)



MySQL Importing Problem??PLS HELP - PrednizoN - 26.04.2016

Код:
INSERT INTO `goldpot_data` VALUES ('7', '-2155.17', '645.512', '52.3672', 'Wu Zi Mu\'dan yeni gцrev var', '3750');
INSERT INTO `goldpot_data` VALUES ('8', '-697.685', '961.485', '12.3017', 'Ilk sьrdьğьm Monster', '3500');
INSERT INTO `goldpot_data` VALUES ('9', '-831.735', '1435.14', '13.7526', 'Kızılderili Зadırları', '3250');
INSERT INTO `goldpot_data` VALUES ('10', '1298.54', '-798.87', '84.1406', 'Madd Dogg evde değl!', '3000');
INSERT INTO `goldpot_data` VALUES ('11', '-2184.5', '2413.15', '5.1563', 'Kaptan olmayı цğren!', '4000');
INSERT INTO `goldpot_data` VALUES ('12', '-1295.92', '2492.24', '87.0318', 'Hayaletli Şehir', '3250');
INSERT INTO `goldpot_data` VALUES ('13', '-228.266', '2662.86', '62.6181', 'Devasa зцl tavuğu', '3600');
INSERT INTO `goldpot_data` VALUES ('14', '-594.467', '2019.28', '60.5381', 'Baraj', '3250');
INSERT INTO `goldpot_data` VALUES ('15', '-127.14', '2258.47', '28.4173', 'Зцldeki tabutlar', '3900');
INSERT INTO `goldpot_data` VALUES ('16', '23[...]
MySQL зıktısı: Belgeler

#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 'INSERT INTO `goldpot_data` VALUES ('8', '-697.685', '961.485', '12.3017', 'Ilk s' at line 2
Where is problem.Pls help


Re: MySQL Importing Problem??PLS HELP - introzen - 26.04.2016

You must define the columns.

PHP код:
 INSERT INTO goldpot_data (IDPosXVALUES ('1' '1234.1111'



Re: MySQL Importing Problem??PLS HELP - PrednizoN - 26.04.2016

Quote:
Originally Posted by introzen
Посмотреть сообщение
You must define the columns.

PHP код:
 INSERT INTO goldpot_data (IDPosXVALUES ('1' '1234.1111'
More detailed explanation or fix Very little information about my MySQL


Re: MySQL Importing Problem??PLS HELP - PrednizoN - 26.04.2016

Up++


Re: MySQL Importing Problem??PLS HELP - AmigaBlizzard - 26.04.2016

Not adding the column-names has nothing to do with this error, as long as you put the values in the proper order as they are defined in the table itself and when all fields are filled.
When exporting a table to a .sql file, it doesn't add column-names as well to your export-file.

The problem is identified in your error message:
PHP код:
#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 'INSERT INTO `goldpot_data` VALUES ('8', '-697.685', '961.485', '12.3017', 'Ilk s' at line 2

Required info:
'INSERT INTO `goldpot_data` VALUES ('8', '-697.685', '961.485', '12.3017', 'Ilk s' at line 2 
It looks like your strings are ended prematurely, probably because of invalid characters in the string.

PHP код:
INSERT INTO `goldpot_dataVALUES ('8''-697.685''961.485''12.3017''Ilk sьrdьğьm Monster''3500'); 
When looking at the full query, it seems the "ь" character isn't supported because the strings breaks at that point.

Can you tell us what database engine you're using (InnoDB or whatever) and which charset?
I tried importing the same text into my database and it works fine when the engine is InnoDB and charset is utf8.


Re: MySQL Importing Problem??PLS HELP - PrednizoN - 26.04.2016

Quote:
Originally Posted by AmigaBlizzard
Посмотреть сообщение
Not adding the column-names has nothing to do with this error, as long as you put the values in the proper order as they are defined in the table itself and when all fields are filled.
When exporting a table to a .sql file, it doesn't add column-names as well to your export-file.

The problem is identified in your error message:
PHP код:
#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 'INSERT INTO `goldpot_data` VALUES ('8', '-697.685', '961.485', '12.3017', 'Ilk s' at line 2
Required info:
'INSERT INTO `goldpot_data` VALUES ('8', '-697.685', '961.485', '12.3017', 'Ilk s' at line 2 
It looks like your strings are ended prematurely, probably because of invalid characters in the string.

PHP код:
INSERT INTO `goldpot_dataVALUES ('8''-697.685''961.485''12.3017''Ilk sьrdьğьm Monster''3500'); 
When looking at the full query, it seems the "ь" character isn't supported because the strings breaks at that point.

Can you tell us what database engine you're using (InnoDB or whatever) and which charset?
I tried importing the same text into my database and it works fine when the engine is InnoDB and charset is utf8.
Код:
-- ----------------------------
-- Table structure for `goldpot_data`
-- ----------------------------
DROP TABLE IF EXISTS `goldpot_data`;
CREATE TABLE `goldpot_data` (
  `id` smallint(3) NOT NULL auto_increment,
  `X` float NOT NULL,
  `Y` float NOT NULL,
  `Z` float NOT NULL,
  `hint` varchar(64) character set latin5 NOT NULL,
  `reward` int(11) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=48 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of goldpot_data
-- ----------------------------
INSERT INTO `goldpot_data` VALUES ('1', '-1048.12', '-1344.42', '130.368', 'Combine Harvester', '3000');
INSERT INTO `goldpot_data` VALUES ('2', '-2678.08', '1272.64', '55.4297', 'Golden Gate', '3250');
INSERT INTO `goldpot_data` VALUES ('3', '-2018.95', '331.716', '35.1719', 'Inşaatı bir tьrlь bitmeyen ZIP mağazası', '3600');
INSERT INTO `goldpot_data` VALUES ('4', '2226.08', '1899.87', '10.8203', 'Radyoda bahsedilen gazino', '3500');
INSERT INTO `goldpot_data` VALUES ('5', '2718.91', '-2405.59', '13.461', 'Forklift', '3000');
INSERT INTO `goldpot_data` VALUES ('6', '2037.22', '2724.91', '10.8203', 'Perkins seni yeni dildosuyla bekliyor', '3250');
INSERT INTO `goldpot_data` VALUES ('7', '-2155.17', '645.512', '52.3672', 'Wu Zi Mu\'dan yeni gцrev var', '3750');
INSERT INTO `goldpot_data` VALUES ('8', '-697.685', '961.485', '12.3017', 'Ilk sьrdьğьm Monster', '3500');
INSERT INTO `goldpot_data` VALUES ('9', '-831.735', '1435.14', '13.7526', 'Kızılderili Зadırları', '3250');
INSERT INTO `goldpot_data` VALUES ('10', '1298.54', '-798.87', '84.1406', 'Madd Dogg evde değl!', '3000');
INSERT INTO `goldpot_data` VALUES ('11', '-2184.5', '2413.15', '5.1563', 'Kaptan olmayı цğren!', '4000');
INSERT INTO `goldpot_data` VALUES ('12', '-1295.92', '2492.24', '87.0318', 'Hayaletli Şehir', '3250');
INSERT INTO `goldpot_data` VALUES ('13', '-228.266', '2662.86', '62.6181', 'Devasa зцl tavuğu', '3600');
INSERT INTO `goldpot_data` VALUES ('14', '-594.467', '2019.28', '60.5381', 'Baraj', '3250');
INSERT INTO `goldpot_data` VALUES ('15', '-127.14', '2258.47', '28.4173', 'Зцldeki tabutlar', '3900');
INSERT INTO `goldpot_data` VALUES ('16', '2351.89', '-1169.35', '28.0113', 'Ben yandım Dennis yanmasın', '3750');
INSERT INTO `goldpot_data` VALUES ('17', '590.309', '877.423', '-42.4973', 'Kocaman bir maden', '3250');
INSERT INTO `goldpot_data` VALUES ('18', '110.559', '1106.13', '13.6094', 'Araз tiyatrosu', '3750');
INSERT INTO `goldpot_data` VALUES ('19', '968.098', '2160.72', '10.8203', 'Et fabrikası', '3350');
INSERT INTO `goldpot_data` VALUES ('20', '2298.35', '-1508.48', '26.8575', 'Jeffrey\'in kaзtığı basketbol sahası', '4000');
INSERT INTO `goldpot_data` VALUES ('21', '2090.2', '1514.84', '10.8203', 'Royal Casino', '3550');
INSERT INTO `goldpot_data` VALUES ('22', '2446.36', '1954.49', '10.7397', 'Gazino hala inşaat halinde', '3700');
INSERT INTO `goldpot_data` VALUES ('23', '2414.02', '1124.04', '10.8203', 'LV Şehir Departmanı', '3250');
INSERT INTO `goldpot_data` VALUES ('24', '2179.83', '1284.71', '10.8203', 'Bьyьk Sphinx\'in hemen alt kısmı', '3500');
INSERT INTO `goldpot_data` VALUES ('25', '2021.34', '1007.66', '10.8203', 'Dragon lovers\' gazinosu', '3550');
INSERT INTO `goldpot_data` VALUES ('26', '2196.01', '1677.03', '12.3672', 'CJ tarafından soyulan gazino', '3250');
INSERT INTO `goldpot_data` VALUES ('27', '868.92', '-29.136', '63.1953', 'Catalina', '3750');
INSERT INTO `goldpot_data` VALUES ('28', '2493.35', '2773.21', '10.8079', 'Askeri yakıt deposu', '4000');
INSERT INTO `goldpot_data` VALUES ('29', '1361.04', '-1278.95', '13.3828', 'LS\'nin en bьyьk Ammu-Nation u', '3400');
INSERT INTO `goldpot_data` VALUES ('30', '2495.09', '-1690.17', '14.7656', 'CJ evi!', '3000');
INSERT INTO `goldpot_data` VALUES ('31', '2199.17', '-1970.46', '13.7841', 'LS зцplьğь', '3100');
INSERT INTO `goldpot_data` VALUES ('32', '2823.15', '-2389.28', '12.0775', 'LS ye demir atan gemi', '3500');
INSERT INTO `goldpot_data` VALUES ('33', '2808.02', '-1177.13', '25.3765', 'LS daki mermi evi', '4250');
INSERT INTO `goldpot_data` VALUES ('34', '-1462.11', '-2636.58', '55.8359', 'Su Deposu', '3750');
INSERT INTO `goldpot_data` VALUES ('35', '1881.87', '-1316.37', '14.5004', 'Kaykay parkının yanındaki inşaat', '3900');
INSERT INTO `goldpot_data` VALUES ('36', '2519.73', '-1272.51', '34.8851', 'S.W.A.T ile yıkılan duvar', '4500');
INSERT INTO `goldpot_data` VALUES ('37', '1415.69', '-806.27', '85.035', 'Зakma Hollywood', '3000');
INSERT INTO `goldpot_data` VALUES ('38', '1554.19', '-1675.59', '16.1953', 'LSPD', '3000');
INSERT INTO `goldpot_data` VALUES ('39', '1117.65', '-2036.96', '78.75', 'Verdant Bluffs dağ evi', '3750');
INSERT INTO `goldpot_data` VALUES ('40', '912.455', '-1235.39', '17.2109', 'Film Stьdyosu', '4000');
INSERT INTO `goldpot_data` VALUES ('41', '811.239', '-1098.34', '25.9063', 'Mezarlık', '3000');
INSERT INTO `goldpot_data` VALUES ('42', '-796.95', '-2057.89', '47.1331', 'Gizli ağaзevi', '4000');
INSERT INTO `goldpot_data` VALUES ('43', '-2817.18', '-1524.12', '140.844', 'MT. Chilliad gizli evi', '3750');
INSERT INTO `goldpot_data` VALUES ('44', '2100.87', '-1649.03', '13.4413', 'CJ\'in ilk sprey gцrevi yeri', '3550');
INSERT INTO `goldpot_data` VALUES ('45', '154.13', '-1946.2', '5.1298', 'Deniz feneri', '3200');
INSERT INTO `goldpot_data` VALUES ('46', '2103.17', '-103.821', '2.275', 'Tekerlikli sandalye', '4000');
INSERT INTO `goldpot_data` VALUES ('47', '1998.61', '2301.62', '10.8203', 'LV Bomba Dьkkanı', '3250');



Re: MySQL Importing Problem??PLS HELP - AmigaBlizzard - 26.04.2016

It looks like your data is in place as intended.

You could try to change the column "hint" and remove the "character set latin5" from it and see if it works without an error.


Re: MySQL Importing Problem??PLS HELP - PrednizoN - 26.04.2016

Quote:
Originally Posted by AmigaBlizzard
Посмотреть сообщение
It looks like your data is in place as intended.

You could try to change the column "hint" and remove the "character set latin5" from it and see if it works without an error.
latin5 what do you suggest instead?


Re: MySQL Importing Problem??PLS HELP - Gammix - 26.04.2016

http://www.tutorialspoint.com/sqlite...sert_query.htm


Re: MySQL Importing Problem??PLS HELP - PrednizoN - 27.04.2016

Quote:
Originally Posted by Gammix
Посмотреть сообщение
I still do not understand where the error is