473,800 Members | 2,413 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

INSERT problem

I am trying to populate a table with the following insert query run
through phpmyadmin. When I attempt to run it phpmyadmin just freezes.
After a while "Fatal error: Maximum execution time of 300 seconds
exceeded in /web/myadmin/283/libraries/import.lib.php on line 19"
appears but no indication as why the command fails. Any advice most
welcome.

INSERT INTO `countries` ( `id` , `country` ) VALUES ('1',
'Abkhazia'), ('2', 'Afghanistan'), ('3', 'Akrotiri and Dhekelia'),
('4', 'Åland'), ('5', 'Albania'), ('6', 'Algeria'), ('7', 'American
Samoa'), ('8', 'Andorra'), ('9', 'Angola'), ('10', 'Anguilla'), ('11',
'Antigua and Barbuda '), ('12', 'Argentina'), ('13', 'Armenia'),
('14', 'Aruba'), ('15', 'Ascension Island'), ('16', 'Australia'),
('17', 'Austria'), ('18', 'Azerbaijan'), ('19', 'Bahamas, The'),
('20', 'Bahrain'), ('21', 'Bangladesh'), ('22', 'Barbados '), ('23',
'Belarus'), ('24', 'Belgium'), ('25', 'Belize '), ('26', 'Benin'),
('27', 'Bermuda'), ('28', 'Bhutan'), ('29', 'Bolivia'), ('30', 'Bosnia
and Herzegovina'), ('31', 'Botswana'), ('32', 'Brazil'), ('33',
'Brunei'), ('34', 'Bulgaria'), ('35', 'Burkina Faso '), ('36',
'Burundi'), ('37', 'Cambodia'), ('38', 'Cameroon'), ('39', 'Canada'),
('40', 'Cape Verde'), ('41', 'Cayman Islands'), ('42', 'Central
African Republic'), ('43', 'Chad'), ('44', 'Chile'), ('45', 'China'),
('46', 'Christmas Island'), ('47', 'Cocos Islands'), ('48',
'Colombia'), ('49', 'Comoros'), ('50', 'Congo, Democratic Republic
of'), ('51', 'Congo, Republic of'), ('52', 'Cook Islands'), ('53',
'Costa Rica'), ('54', 'Côte d'Ivoire'), ('55', 'Croatia'), ('56',
'Cuba'), ('57', 'Cyprus'), ('58', 'Czech Republic'), ('59',
'Denmark'), ('60', 'Djibouti'), ('61', 'Dominica'), ('62', 'Dominican
Republic '), ('63', 'Ecuador'), ('64', 'Egypt'), ('65', 'El
Salvador'), ('66', 'Equatorial Guinea'), ('67', 'Eritrea'), ('68',
'Estonia'), ('69', 'Ethiopia'), ('70', 'Falkland Islands'), ('71',
'Faroe Islands'), ('72', 'Fiji'), ('73', 'Finland'), ('74', 'France'),
('75', 'French Polynesia'), ('76', 'Gabon'), ('77', 'Gambia, The'),
('78', 'Georgia'), ('79', 'Germany'), ('80', 'Ghana'), ('81',
'Gibraltar'), ('82', 'Greece'), ('83', 'Greenland'), ('84', 'Grenada
'), ('85', 'Guam'), ('86', 'Guatemala'), ('87', 'Guernsey'), ('88',
'Guinea'), ('89', 'Guinea-Bissau'), ('90', 'Guyana'), ('91', 'Haiti'),
('92', 'Honduras'), ('93', 'Hong Kong'), ('94', 'Hungary'), ('95',
'Iceland'), ('96', 'India'), ('97', 'Indonesia'), ('98', 'Iran'),
('99', 'Iraq'), ('100', 'Ireland'), ('101', 'Isle of Man'), ('102',
'Israel'), ('103', 'Italy'), ('104', 'Jamaica '), ('105', 'Japan '),
('106', 'Jersey'), ('107', 'Jordan'), ('108', 'Kazakhstan'), ('109',
'Kenya'), ('110', 'Kiribati'), ('111', 'Kosovo'), ('112', 'Kuwait'),
('113', 'Kyrgyzstan'), ('114', 'Laos'), ('115', 'Latvia'), ('116',
'Lebanon'), ('117', 'Lesotho'), ('118', 'Liberia'), ('119', 'Libya'),
('120', 'Liechtenstein' ), ('121', 'Lithuania'), ('122', 'Luxembourg'),
('123', 'Macao'), ('124', 'Madagascar'), ('125', 'Malawi'), ('126',
'Malaysia '), ('127', 'Maldives'), ('128', 'Mali'), ('129', 'Malta'),
('130', 'Marshall Islands'), ('131', 'Mauritania'), ('132',
'Mauritius'), ('133', 'Mayotte'), ('134', 'Mexico'), ('135',
'Micronesia'), ('136', 'Moldova'), ('137', 'Monaco'), ('138',
'Mongolia '), ('139', 'Montenegro'), ('140', 'Montserrat'), ('141',
'Morocco'), ('142', 'Mozambique'), ('143', 'Myanmar'), ('144',
'Nagorno-Karabakh'), ('145', 'Namibia'), ('146', 'Nauru'), ('147',
'Nepal'), ('148', 'Netherlands'), ('149', 'Netherlands Antilles'),
('150', 'New Caledonia'), ('151', 'New Zealand '), ('152',
'Nicaragua'), ('153', 'Niger'), ('154', 'Nigeria'), ('155', 'Niue'),
('156', 'Norfolk Island'), ('157', 'North Korea'), ('158', 'Northern
Cyprus'), ('159', 'Northern Mariana Islands'), ('160', 'Norway'),
('161', 'Oman'), ('162', 'Pakistan'), ('163', 'Palau'), ('164',
'Palestine'), ('165', 'Panama'), ('166', 'Papua New Guinea'), ('167',
'Paraguay'), ('168', 'Peru'), ('169', 'Philippines'), ('170',
'Pitcairn Islands'), ('171', 'Poland'), ('172', 'Portugal'), ('173',
'Pridnestrovie' ), ('174', 'Puerto Rico'), ('175', 'Qatar'), ('176',
'Republic of Macedonia'), ('177', 'Romania '), ('178', 'Russia'),
('179', 'Rwanda'), ('180', 'Saint Helena'), ('181', 'Saint Kitts and
Nevis'), ('182', 'Saint Lucia '), ('183', 'Saint Pierre and
Miquelon'), ('184', 'Saint Vincent & the Grenadines'), ('185',
'Samoa'), ('186', 'San Marino'), ('187', 'São Tomé and Príncipe'),
('188', 'Saudi Arabia'), ('189', 'Senegal'), ('190', 'Serbia'),
('191', 'Seychelles'), ('192', 'Sierra Leone'), ('193', 'Singapore'),
('194', 'Slovakia'), ('195', 'Slovenia'), ('196', 'Solomon Islands '),
('197', 'Somalia'), ('198', 'Somaliland'), ('199', 'South Africa'),
('200', 'South Korea'), ('201', 'South Ossetia'), ('202', 'Spain'),
('203', 'Sri Lanka'), ('204', 'Sudan'), ('205', 'Suriname'), ('206',
'Svalbard'), ('207', 'Swaziland'), ('208', 'Sweden'), ('209',
'Switzerland'), ('210', 'Syria'), ('211', 'Taiwan'), ('212',
'Tajikistan'), ('213', 'Tanzania'), ('214', 'Thailand'), ('215',
'Timor-Leste'), ('216', 'Togo'), ('217', 'Tokelau'), ('218', 'Tonga'),
('219', 'Trinidad and Tobago'), ('220', 'Tristan da Cunha'), ('221',
'Tunisia'), ('222', 'Turkey'), ('223', 'Turkmenistan '), ('224',
'Turks and Caicos Islands'), ('225', 'Tuvalu '), ('226', 'Uganda'),
('227', 'Ukraine '), ('228', 'United Arab Emirates '), ('229', 'United
Kingdom'), ('230', 'United States'), ('231', 'Uruguay'), ('232',
'Uzbekistan'), ('233', 'Vanuatu'), ('234', 'Vatican City'), ('235',
'Venezuela'), ('236', 'Vietnam'), ('237', 'Virgin Islands, British'),
('238', 'Virgin Islands, United States'), ('239', 'Wallis and
Futuna'), ('240', 'Western Sahara'), ('241', 'Yemen'), ('242',
'Zambia'), ('243', 'Zimbabwe');

Jan 27 '07 #1
15 5270
>I am trying to populate a table with the following insert query run=20
>through phpmyadmin. When I attempt to run it phpmyadmin just freezes.=20
After a while "Fatal error: Maximum execution time of 300 seconds=20
exceeded in /web/myadmin/283/libraries/import.lib.php on line 19"=20
appears but no indication as why the command fails. Any advice most=20
PHP has limits on the execution (real) time of a web page. You
went over it. PHP doesn't know *WHY* it went over the limit, it
just knows that it did. You can raise the limit in php.ini (then
restart the web server), but that may be just masking the symptoms
rather than solving the problem.

This query doesn't look that big or complicated, although it might
have gotten mangled by all the equal-sign two zero crap at the end
of lines. Possibly something else has the table locked? The server
is very busy doing something else?
>welcome.

INSERT INTO `countries` ( `id` , `country` ) VALUES ('1',=20
'Abkhazia'), ('2', 'Afghanistan'), ('3', 'Akrotiri and Dhekelia'),=20
('4', '=C5land'), ('5', 'Albania'), ('6', 'Algeria'), ('7', 'American=20
Samoa'), ('8', 'Andorra'), ('9', 'Angola'), ('10', 'Anguilla'), ('11',=20
'Antigua and Barbuda '), ('12', 'Argentina'), ('13', 'Armenia'),=20
('14', 'Aruba'), ('15', 'Ascension Island'), ('16', 'Australia'),=2 0
('17', 'Austria'), ('18', 'Azerbaijan'), ('19', 'Bahamas, The'),=20
('20', 'Bahrain'), ('21', 'Bangladesh'), ('22', 'Barbados '), ('23',=20
'Belarus'), ('24', 'Belgium'), ('25', 'Belize '), ('26', 'Benin'),=20
('27', 'Bermuda'), ('28', 'Bhutan'), ('29', 'Bolivia'), ('30', 'Bosnia=20
and Herzegovina'), ('31', 'Botswana'), ('32', 'Brazil'), ('33',=20
'Brunei'), ('34', 'Bulgaria'), ('35', 'Burkina Faso '), ('36',=20
'Burundi'), ('37', 'Cambodia'), ('38', 'Cameroon'), ('39', 'Canada'),=20
('40', 'Cape Verde'), ('41', 'Cayman Islands'), ('42', 'Central=20
African Republic'), ('43', 'Chad'), ('44', 'Chile'), ('45', 'China'),=20
('46', 'Christmas Island'), ('47', 'Cocos Islands'), ('48',=20
'Colombia'), ('49', 'Comoros'), ('50', 'Congo, Democratic Republic=20
of'), ('51', 'Congo, Republic of'), ('52', 'Cook Islands'), ('53',=20
'Costa Rica'), ('54', 'C=F4te d'Ivoire'), ('55', 'Croatia'), ('56',=20
'Cuba'), ('57', 'Cyprus'), ('58', 'Czech Republic'), ('59',=20
'Denmark'), ('60', 'Djibouti'), ('61', 'Dominica'), ('62', 'Dominican=20
Republic '), ('63', 'Ecuador'), ('64', 'Egypt'), ('65', 'El=20
Salvador'), ('66', 'Equatorial Guinea'), ('67', 'Eritrea'), ('68',=20
'Estonia'), ('69', 'Ethiopia'), ('70', 'Falkland Islands'), ('71',=20
'Faroe Islands'), ('72', 'Fiji'), ('73', 'Finland'), ('74', 'France'),=20
('75', 'French Polynesia'), ('76', 'Gabon'), ('77', 'Gambia, The'),=20
('78', 'Georgia'), ('79', 'Germany'), ('80', 'Ghana'), ('81',=20
'Gibraltar') , ('82', 'Greece'), ('83', 'Greenland'), ('84', 'Grenada=20
'), ('85', 'Guam'), ('86', 'Guatemala'), ('87', 'Guernsey'), ('88',=20
'Guinea'), ('89', 'Guinea-Bissau'), ('90', 'Guyana'), ('91', 'Haiti'),=20
('92', 'Honduras'), ('93', 'Hong Kong'), ('94', 'Hungary'), ('95',=20
'Iceland'), ('96', 'India'), ('97', 'Indonesia'), ('98', 'Iran'),=20
('99', 'Iraq'), ('100', 'Ireland'), ('101', 'Isle of Man'), ('102',=20
'Israel'), ('103', 'Italy'), ('104', 'Jamaica '), ('105', 'Japan '),=20
('106', 'Jersey'), ('107', 'Jordan'), ('108', 'Kazakhstan'), ('109',=20
'Kenya'), ('110', 'Kiribati'), ('111', 'Kosovo'), ('112', 'Kuwait'),=20
('113', 'Kyrgyzstan'), ('114', 'Laos'), ('115', 'Latvia'), ('116',=20
'Lebanon'), ('117', 'Lesotho'), ('118', 'Liberia'), ('119', 'Libya'),=20
('120', 'Liechtenstein' ), ('121', 'Lithuania'), ('122', 'Luxembourg'),= 20
('123', 'Macao'), ('124', 'Madagascar'), ('125', 'Malawi'), ('126',=20
'Malaysia '), ('127', 'Maldives'), ('128', 'Mali'), ('129', 'Malta'),=20
('130', 'Marshall Islands'), ('131', 'Mauritania'), ('132',=20
'Mauritius') , ('133', 'Mayotte'), ('134', 'Mexico'), ('135',=20
'Micronesia' ), ('136', 'Moldova'), ('137', 'Monaco'), ('138',=20
'Mongolia '), ('139', 'Montenegro'), ('140', 'Montserrat'), ('141',=20
'Morocco'), ('142', 'Mozambique'), ('143', 'Myanmar'), ('144',=20
'Nagorno-Karabakh'), ('145', 'Namibia'), ('146', 'Nauru'), ('147',=20
'Nepal'), ('148', 'Netherlands'), ('149', 'Netherlands Antilles'),=20
('150', 'New Caledonia'), ('151', 'New Zealand '), ('152',=20
'Nicaragua') , ('153', 'Niger'), ('154', 'Nigeria'), ('155', 'Niue'),=20
('156', 'Norfolk Island'), ('157', 'North Korea'), ('158', 'Northern=20
Cyprus'), ('159', 'Northern Mariana Islands'), ('160', 'Norway'),=20
('161', 'Oman'), ('162', 'Pakistan'), ('163', 'Palau'), ('164',=20
'Palestine') , ('165', 'Panama'), ('166', 'Papua New Guinea'), ('167',=20
'Paraguay'), ('168', 'Peru'), ('169', 'Philippines'), ('170',=20
'Pitcairn Islands'), ('171', 'Poland'), ('172', 'Portugal'), ('173',=20
'Pridnestrovie '), ('174', 'Puerto Rico'), ('175', 'Qatar'), ('176',=20
'Republic of Macedonia'), ('177', 'Romania '), ('178', 'Russia'),=20
('179', 'Rwanda'), ('180', 'Saint Helena'), ('181', 'Saint Kitts and=20
Nevis'), ('182', 'Saint Lucia '), ('183', 'Saint Pierre and=20
Miquelon'), ('184', 'Saint Vincent & the Grenadines'), ('185',=20
'Samoa'), ('186', 'San Marino'), ('187', 'S=E3o Tom=E9 and Pr=EDncipe'),=2 0
('188', 'Saudi Arabia'), ('189', 'Senegal'), ('190', 'Serbia'),=20
('191', 'Seychelles'), ('192', 'Sierra Leone'), ('193', 'Singapore'),=2 0
('194', 'Slovakia'), ('195', 'Slovenia'), ('196', 'Solomon Islands '),=20
('197', 'Somalia'), ('198', 'Somaliland'), ('199', 'South Africa'),=20
('200', 'South Korea'), ('201', 'South Ossetia'), ('202', 'Spain'),=20
('203', 'Sri Lanka'), ('204', 'Sudan'), ('205', 'Suriname'), ('206',=20
'Svalbard'), ('207', 'Swaziland'), ('208', 'Sweden'), ('209',=20
'Switzerland') , ('210', 'Syria'), ('211', 'Taiwan'), ('212',=20
'Tajikistan' ), ('213', 'Tanzania'), ('214', 'Thailand'), ('215',=20
'Timor-Leste'), ('216', 'Togo'), ('217', 'Tokelau'), ('218', 'Tonga'),=20
('219', 'Trinidad and Tobago'), ('220', 'Tristan da Cunha'), ('221',=20
'Tunisia'), ('222', 'Turkey'), ('223', 'Turkmenistan '), ('224',=20
'Turks and Caicos Islands'), ('225', 'Tuvalu '), ('226', 'Uganda'),=20
('227', 'Ukraine '), ('228', 'United Arab Emirates '), ('229', 'United=20
Kingdom'), ('230', 'United States'), ('231', 'Uruguay'), ('232',=20
'Uzbekistan' ), ('233', 'Vanuatu'), ('234', 'Vatican City'), ('235',=20
'Venezuela') , ('236', 'Vietnam'), ('237', 'Virgin Islands, British'),=20
('238', 'Virgin Islands, United States'), ('239', 'Wallis and=20
Futuna'), ('240', 'Western Sahara'), ('241', 'Yemen'), ('242',=20
'Zambia'), ('243', 'Zimbabwe');

Jan 27 '07 #2
ab**********@ya hoo.com wrote:
I am trying to populate a table with the following insert query run
through phpmyadmin. When I attempt to run it phpmyadmin just freezes.
After a while "Fatal error: Maximum execution time of 300 seconds
exceeded in /web/myadmin/283/libraries/import.lib.php on line 19"
appears but no indication as why the command fails. Any advice most
welcome.

INSERT INTO `countries` ( `id` , `country` )
There are a couple of problems. First, don't use quotes for your table
& field names. Do this instead:

INSERT INTO countries (id, country)

A couple of other things:

Country ID's 4, 54 & 187 contain high ASCII values, if they don't import
properly edit those specific rows & paste in again. If it still doesn't
work check your collation.

Also, country ID 54 has a single quote within the name, so you may wish
to use double-quotes to enclose your values.

It was a combination of enclosing the table & field defs in quotes, and
having a single quote in country 54 along with using single quotes as
your delimiter, that caused the import to fail.
Jan 28 '07 #3
ab**********@ya hoo.com wrote:
I am trying to populate a table with the following insert query run
through phpmyadmin. When I attempt to run it phpmyadmin just freezes.
After a while "Fatal error: Maximum execution time of 300 seconds
exceeded in /web/myadmin/283/libraries/import.lib.php on line 19"
appears but no indication as why the command fails. Any advice most
welcome.

INSERT INTO `countries` ( `id` , `country` ) VALUES ('1',
'Abkhazia'), ('2', 'Afghanistan'), ('3', 'Akrotiri and Dhekelia'),
('4', 'Åland'), ('5', 'Albania'), ('6', 'Algeria'), ('7', 'American
Samoa'), ('8', 'Andorra'), ('9', 'Angola'), ('10', 'Anguilla'), ('11',
'Antigua and Barbuda '), ('12', 'Argentina'), ('13', 'Armenia'),
('14', 'Aruba'), ('15', 'Ascension Island'), ('16', 'Australia'),
('17', 'Austria'), ('18', 'Azerbaijan'), ('19', 'Bahamas, The'),
('20', 'Bahrain'), ('21', 'Bangladesh'), ('22', 'Barbados '), ('23',
'Belarus'), ('24', 'Belgium'), ('25', 'Belize '), ('26', 'Benin'),
('27', 'Bermuda'), ('28', 'Bhutan'), ('29', 'Bolivia'), ('30', 'Bosnia
and Herzegovina'), ('31', 'Botswana'), ('32', 'Brazil'), ('33',
'Brunei'), ('34', 'Bulgaria'), ('35', 'Burkina Faso '), ('36',
'Burundi'), ('37', 'Cambodia'), ('38', 'Cameroon'), ('39', 'Canada'),
('40', 'Cape Verde'), ('41', 'Cayman Islands'), ('42', 'Central
African Republic'), ('43', 'Chad'), ('44', 'Chile'), ('45', 'China'),
('46', 'Christmas Island'), ('47', 'Cocos Islands'), ('48',
'Colombia'), ('49', 'Comoros'), ('50', 'Congo, Democratic Republic
of'), ('51', 'Congo, Republic of'), ('52', 'Cook Islands'), ('53',
'Costa Rica'), ('54', 'Côte d'Ivoire'), ('55', 'Croatia'), ('56',
'Cuba'), ('57', 'Cyprus'), ('58', 'Czech Republic'), ('59',
'Denmark'), ('60', 'Djibouti'), ('61', 'Dominica'), ('62', 'Dominican
Republic '), ('63', 'Ecuador'), ('64', 'Egypt'), ('65', 'El
Salvador'), ('66', 'Equatorial Guinea'), ('67', 'Eritrea'), ('68',
'Estonia'), ('69', 'Ethiopia'), ('70', 'Falkland Islands'), ('71',
'Faroe Islands'), ('72', 'Fiji'), ('73', 'Finland'), ('74', 'France'),
('75', 'French Polynesia'), ('76', 'Gabon'), ('77', 'Gambia, The'),
('78', 'Georgia'), ('79', 'Germany'), ('80', 'Ghana'), ('81',
'Gibraltar'), ('82', 'Greece'), ('83', 'Greenland'), ('84', 'Grenada
'), ('85', 'Guam'), ('86', 'Guatemala'), ('87', 'Guernsey'), ('88',
'Guinea'), ('89', 'Guinea-Bissau'), ('90', 'Guyana'), ('91', 'Haiti'),
('92', 'Honduras'), ('93', 'Hong Kong'), ('94', 'Hungary'), ('95',
'Iceland'), ('96', 'India'), ('97', 'Indonesia'), ('98', 'Iran'),
('99', 'Iraq'), ('100', 'Ireland'), ('101', 'Isle of Man'), ('102',
'Israel'), ('103', 'Italy'), ('104', 'Jamaica '), ('105', 'Japan '),
('106', 'Jersey'), ('107', 'Jordan'), ('108', 'Kazakhstan'), ('109',
'Kenya'), ('110', 'Kiribati'), ('111', 'Kosovo'), ('112', 'Kuwait'),
('113', 'Kyrgyzstan'), ('114', 'Laos'), ('115', 'Latvia'), ('116',
'Lebanon'), ('117', 'Lesotho'), ('118', 'Liberia'), ('119', 'Libya'),
('120', 'Liechtenstein' ), ('121', 'Lithuania'), ('122', 'Luxembourg'),
('123', 'Macao'), ('124', 'Madagascar'), ('125', 'Malawi'), ('126',
'Malaysia '), ('127', 'Maldives'), ('128', 'Mali'), ('129', 'Malta'),
('130', 'Marshall Islands'), ('131', 'Mauritania'), ('132',
'Mauritius'), ('133', 'Mayotte'), ('134', 'Mexico'), ('135',
'Micronesia'), ('136', 'Moldova'), ('137', 'Monaco'), ('138',
'Mongolia '), ('139', 'Montenegro'), ('140', 'Montserrat'), ('141',
'Morocco'), ('142', 'Mozambique'), ('143', 'Myanmar'), ('144',
'Nagorno-Karabakh'), ('145', 'Namibia'), ('146', 'Nauru'), ('147',
'Nepal'), ('148', 'Netherlands'), ('149', 'Netherlands Antilles'),
('150', 'New Caledonia'), ('151', 'New Zealand '), ('152',
'Nicaragua'), ('153', 'Niger'), ('154', 'Nigeria'), ('155', 'Niue'),
('156', 'Norfolk Island'), ('157', 'North Korea'), ('158', 'Northern
Cyprus'), ('159', 'Northern Mariana Islands'), ('160', 'Norway'),
('161', 'Oman'), ('162', 'Pakistan'), ('163', 'Palau'), ('164',
'Palestine'), ('165', 'Panama'), ('166', 'Papua New Guinea'), ('167',
'Paraguay'), ('168', 'Peru'), ('169', 'Philippines'), ('170',
'Pitcairn Islands'), ('171', 'Poland'), ('172', 'Portugal'), ('173',
'Pridnestrovie' ), ('174', 'Puerto Rico'), ('175', 'Qatar'), ('176',
'Republic of Macedonia'), ('177', 'Romania '), ('178', 'Russia'),
('179', 'Rwanda'), ('180', 'Saint Helena'), ('181', 'Saint Kitts and
Nevis'), ('182', 'Saint Lucia '), ('183', 'Saint Pierre and
Miquelon'), ('184', 'Saint Vincent & the Grenadines'), ('185',
'Samoa'), ('186', 'San Marino'), ('187', 'São Tomé and Príncipe'),
('188', 'Saudi Arabia'), ('189', 'Senegal'), ('190', 'Serbia'),
('191', 'Seychelles'), ('192', 'Sierra Leone'), ('193', 'Singapore'),
('194', 'Slovakia'), ('195', 'Slovenia'), ('196', 'Solomon Islands '),
('197', 'Somalia'), ('198', 'Somaliland'), ('199', 'South Africa'),
('200', 'South Korea'), ('201', 'South Ossetia'), ('202', 'Spain'),
('203', 'Sri Lanka'), ('204', 'Sudan'), ('205', 'Suriname'), ('206',
'Svalbard'), ('207', 'Swaziland'), ('208', 'Sweden'), ('209',
'Switzerland'), ('210', 'Syria'), ('211', 'Taiwan'), ('212',
'Tajikistan'), ('213', 'Tanzania'), ('214', 'Thailand'), ('215',
'Timor-Leste'), ('216', 'Togo'), ('217', 'Tokelau'), ('218', 'Tonga'),
('219', 'Trinidad and Tobago'), ('220', 'Tristan da Cunha'), ('221',
'Tunisia'), ('222', 'Turkey'), ('223', 'Turkmenistan '), ('224',
'Turks and Caicos Islands'), ('225', 'Tuvalu '), ('226', 'Uganda'),
('227', 'Ukraine '), ('228', 'United Arab Emirates '), ('229', 'United
Kingdom'), ('230', 'United States'), ('231', 'Uruguay'), ('232',
'Uzbekistan'), ('233', 'Vanuatu'), ('234', 'Vatican City'), ('235',
'Venezuela'), ('236', 'Vietnam'), ('237', 'Virgin Islands, British'),
('238', 'Virgin Islands, United States'), ('239', 'Wallis and
Futuna'), ('240', 'Western Sahara'), ('241', 'Yemen'), ('242',
'Zambia'), ('243', 'Zimbabwe');
Despite other comments, the backticks around your table and column names
are fine. They are valid for MySQL.

If `id` is a numeric value, you should not have quotes around the
numeric values, i.e. you should have (1, 'Abkhazia').

Also as noted, the entry with value 54 has a single quote in it.
Enclosing the values within double quotes is not correct, however - that
is invalid SQL (strings must be enclosed by single quotes).

The way to correct this is to have two single quotes in the string, i.e.
'Côte d''Ivoire'

The non-ASCII characters (i.e. 'Åland') may or may not be a problem - it
depends on the table definition.

I'm not sure why this would give a timeout error, though. It shouldn't
take long for it to be inserted. I'd recommend you break it up into
smaller chunks and see what happens. You should be able to determine if
there are other errors in your SQL that we've missed.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Jan 28 '07 #4
Jerry Stuckle wrote:
Despite other comments, the backticks around your table and column names
are fine. They are valid for MySQL.

If `id` is a numeric value, you should not have quotes around the
numeric values, i.e. you should have (1, 'Abkhazia').

Also as noted, the entry with value 54 has a single quote in it.
Enclosing the values within double quotes is not correct, however - that
is invalid SQL (strings must be enclosed by single quotes).

The way to correct this is to have two single quotes in the string, i.e.
'Côte d''Ivoire'

The non-ASCII characters (i.e. 'Åland') may or may not be a problem - it
depends on the table definition.

I'm not sure why this would give a timeout error, though. It shouldn't
take long for it to be inserted. I'd recommend you break it up into
smaller chunks and see what happens. You should be able to determine if
there are other errors in your SQL that we've missed.
This does not seem to be accurate. At least as far back as MySQL
version 3.23, double-quotes are most certainly acceptable for enclosing
strings. Section 9.1.1 of the manual details this:

A string is a sequence of bytes or characters, enclosed within either
single quote (‘'’) or double quote (‘"’) characters.

Did fail to mention previously that the quotes as shown in the original
post were ASCII 60's (96 in decimal), not 27's (decimal 39). That also
caused my attempt at importing to fail.

So far as surrounding table names in the insert statement with quotes, I
couldn't find it in the manual, and it bombed when I tried it. Am
curious where you got this info.

And yes, the collation will definitely be an issue. Defining the
'country' column as utf8_general_ci , the records 4, 54 & 187 did not
import the country name. Set to ASCII, the high ascii chars imported as
question marks (Hex code 3F, ASCII 63), but the remainder of the string
came in OK.
Jan 29 '07 #5
Carl Pearson wrote:
This does not seem to be accurate. At least as far back as MySQL
version 3.23, double-quotes are most certainly acceptable for enclosing
strings. Section 9.1.1 of the manual details this:
Yeah, it is. I recently lost an argument I was very confident
about - that double-quotes is actually the ANSI standard. I got
so used to using double-quotes, I forgot they were the wrong way
to do strings.
Jan 29 '07 #6
Carl Pearson wrote:
Jerry Stuckle wrote:
>Despite other comments, the backticks around your table and column
names are fine. They are valid for MySQL.

If `id` is a numeric value, you should not have quotes around the
numeric values, i.e. you should have (1, 'Abkhazia').

Also as noted, the entry with value 54 has a single quote in it.
Enclosing the values within double quotes is not correct, however -
that is invalid SQL (strings must be enclosed by single quotes).

The way to correct this is to have two single quotes in the string,
i.e. 'Côte d''Ivoire'

The non-ASCII characters (i.e. 'Åland') may or may not be a problem -
it depends on the table definition.

I'm not sure why this would give a timeout error, though. It
shouldn't take long for it to be inserted. I'd recommend you break it
up into smaller chunks and see what happens. You should be able to
determine if there are other errors in your SQL that we've missed.

This does not seem to be accurate. At least as far back as MySQL
version 3.23, double-quotes are most certainly acceptable for enclosing
strings. Section 9.1.1 of the manual details this:
The SQL standard is to enclose all strings with single quotes.
A string is a sequence of bytes or characters, enclosed within
either single quote (‘'’) or double quote (‘"’) characters.

Did fail to mention previously that the quotes as shown in the original
post were ASCII 60's (96 in decimal), not 27's (decimal 39). That also
caused my attempt at importing to fail.
The quotes around the table and column names were ASCII 96 decimal - a
backtick, which is correct for MySQL. The ones around the values were
ASCII 39 decimal, which is again correct.
So far as surrounding table names in the insert statement with quotes, I
couldn't find it in the manual, and it bombed when I tried it. Am
curious where you got this info.
It requires back ticks. Check the manual. It's there, very
prominently. And has been since at least version 3.x.
And yes, the collation will definitely be an issue. Defining the
'country' column as utf8_general_ci , the records 4, 54 & 187 did not
import the country name. Set to ASCII, the high ascii chars imported as
question marks (Hex code 3F, ASCII 63), but the remainder of the string
came in OK.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Jan 29 '07 #7
Sanders Kaufman wrote:
Carl Pearson wrote:
>This does not seem to be accurate. At least as far back as MySQL
version 3.23, double-quotes are most certainly acceptable for
enclosing strings. Section 9.1.1 of the manual details this:

Yeah, it is. I recently lost an argument I was very confident about -
that double-quotes is actually the ANSI standard. I got so used to
using double-quotes, I forgot they were the wrong way to do strings.
It may. But I use standard SQL so I have less to change should I need
to go to a different database. And standard SQL is to use single quotes
around non-numeric values.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Jan 29 '07 #8
Jerry Stuckle wrote:
Carl Pearson wrote:
>So far as surrounding table names in the insert statement with quotes,
I couldn't find it in the manual, and it bombed when I tried it. Am
curious where you got this info.

It requires back ticks. Check the manual. It's there, very
prominently. And has been since at least version 3.x.
Allow me to clarify this. If you're going to enclose table and/or
column names, they must be back ticks. And back ticks are required if
you're using MySQL reserved words as column or table names.
--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Jan 29 '07 #9
Jerry Stuckle wrote:
Jerry Stuckle wrote:
>Carl Pearson wrote:
>>So far as surrounding table names in the insert statement with
quotes, I couldn't find it in the manual, and it bombed when I tried
it. Am curious where you got this info.

It requires back ticks. Check the manual. It's there, very
prominently. And has been since at least version 3.x.
Time to put this to rest.

At least your statement above is *half* right. I was looking at the
wrong section, 9.1.1 (which defines what a string can be), not 9.2
(which defines what table, index, column & alias names can be).

But 9.2 does also state:
An identifier may be quoted or unquoted.

The only exception would be using reserved words, but 'id' and
'countries' are not on that list.

Still, saying that surrounding table names with quotes is 'required' is
not true.
>
Allow me to clarify this. If you're going to enclose table and/or
column names, they must be back ticks. And back ticks are required if
you're using MySQL reserved words as column or table names.

Well, that's certainly what the manual says, but it's not the way it's
working in practice.

Locally am on 5.0.27-community, haven't tried any on a web host.

The insert bombed for me until I took out any form of quoting from the
table & column names. i.e.,

Then I took another look at the original post.

The entire problem was not as I originally stated, having the table &
field defs in quotes.

It was actually that back ticks were *also used for the data*.

So, to re-cap:
Backticks only for enclosing table & field names, NOT data!
Single OR double quotes around data are OK - even numbers!

This may not be the *preferred* way, but it's legal syntax.

Now, tiny rant here...

Yes, you are correct that backticks are allowed to identify table names,
and I thank you for getting me to look a little harder to discover that.

But, this is a MySQL list, NOT an ANSI SQL list, and double-quotes -
whether or not you disagree with using them - are valid syntax in MySQL.

Point is, even though I had a couple of facts about table defs wrong, I
still got the insert to work! You could have done the same, or at least
looked a little harder at the problem, rather than just dismiss my
answer because it had it's own syntax error.
Jan 29 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
5650
by: newbie_mw | last post by:
Hi, I need urgent help with a novice problem. I would appreciate any advice, suggestions... Thanks a lot in advance! Here it is: I created a sign-up sheet (reg.html) where people fill in their first name, last name, email, etc. The data are then sent to a PHP script (reg.php). The data are then inserted into a table (reg) in MS SQL server. I have declared the variables like this: if (!(isset($_POST))) { $FirstName = "" ;
14
4302
by: serge | last post by:
I have a scenario where two tables are in a One-to-Many relationship and I need to move the data from the Many table to the One table so that it becomes a One-to-One relationship. I need to salvage the records from the many table and without going into detail, one of the reasons I can't do the opposite as there are records in the ONE table that I need to keep even if they don't have any child records in the MANY table. Below I created...
0
3152
by: jtocci | last post by:
I'm having a big problem with CREATE RULE...ON INSERT...INSERT INTO...SELECT...FROM...WHERE when I want to INSERT several (20~50) records based on a single INSERT to a view. Either I get a 'too much data for field' or the query just runs on and on til I have to restart the postmaster. I have found rules to compare mine to but people limit the resulting insert to one record (the WHERE generally limits the result of the SELECT to one...
16
17023
by: Philip Boonzaaier | last post by:
I want to be able to generate SQL statements that will go through a list of data, effectively row by row, enquire on the database if this exists in the selected table- If it exists, then the colums must be UPDATED, if not, they must be INSERTED. Logically then, I would like to SELECT * FROM <TABLE> WHERE ....<Values entered here>, and then IF FOUND UPDATE <TABLE> SET .... <Values entered here> ELSE INSERT INTO <TABLE> VALUES <Values...
8
6300
by: Carl | last post by:
Hi, I hope someone can share some of their professional advice and help me out with my embarissing problem concerning an Access INSERT query. I have never attempted to create a table with one-to-one relationship but on this occasion I must keep username/password details within a seperate table. Here's the basic specs and database schema: -------------------------------------------
2
2037
by: alexmaster_2004 | last post by:
hi i have made an application using C# that access sql2000. this application is just used to insert data to the database. i use something like this in my code: // string colmnA = TextBox1.Text; string comlnB = TextBox2.Text; string sqlstatment = "INSERT INTO TABLENAME VALUES(" +"'"+colmnA+"'" + "," + "'" + colmnB + "'" + ")";
7
4354
by: Lorenzino | last post by:
Hi, I have a problem with bindings in a formview. I have a formview; in the insert template i've created a wizard control and inside it i have an HTML table with some textboxes bound to the sqldatasource of the formview. If i put this textboxes outside the table everything works well, but as soon as i put them inside the table (in order to organize the layout in the right way) they doesn't work. They works only as eval() and not bind()...
4
4866
by: =?Utf-8?B?UmljaA==?= | last post by:
On a form - I have a datagridview which is docked to the entire form. The datagridview allows users to Delete and/or Add Rows. On the Form_Load event I Fill the datagridview source table with a sql DataAdapter (da) da.SelectCommand.CommandText = "Select * from Servertbl1" da.Fill(ds, "tbl1") so far, so good. If I add a row to the datagridview I use the following sqlDataAdapter code to update the server table - which works OK when...
6
3683
by: sgulciny | last post by:
hi friends; I have problem about sql server insert and update in client side. I am coding windows application with c#.When I run my code in database server computer all is fine.I can see data, insert and update.But when I run same code in client side I can see data but not insert not update what can I do about this problem .I use sql server 2000 database.Client side connections ok. :( thanks for all
8
5029
by: Red | last post by:
If auto-format is turned off in VS2008, there is apparently no way to indent a line. Under Tools->Options->Text Editor->C#->Formatting, there are three checkboxes. Unchecking those seems to cause this behavior. I'd simply like to have the tab key insert a tab at the beginning of a line. I believe that there were publlished macros for doing this in earlier VS versions, but I expected this to be 'fixed' in VS2008. Yes, I realize someone...
0
9551
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10505
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10275
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10253
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10033
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9085
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5471
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2945
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.