I was working from unclear info, and copying what I saw in the already existing code:
NOT NULL default ‘0’, so I did the same
I want to now populate each table with info like:
INSERT INTO ip2nation (ip, country) VALUES(184549375, ‘us’);
INSERT INTO ip2nation (ip, country) VALUES(3332726783, ‘ca’);
INSERT INTO ip2nationCountries (code, country, lat, lon) VALUES(‘ad’, ‘Andorra’, 42.3, 1.3);
INSERT INTO ip2nationCountries (code, country, lat, lon) VALUES(‘ae’, ‘United Arab Emirates’, 24, 54);
Is this code below correct to populate the “ip2nation” table?
$db_desc = “Populating <b>ip2nation</b> table”;
$db_query = "INSERT INTO " . DB_PREFIX . "ip2nation VALUES
(184549375, ‘us’),
(3332726783, ‘ca’),
and more
and another
and more …
I get a SQL Error for the ($db_desc = “Creating <b>ip2nation</b> table” below the dotted line,
all help appreciated
Mysql Error Output: 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 ‘’ at line 5
SQL Query: CREATE TABLE ip2nation ( ip int(11) unsigned NOT NULL default 0, country varchar(2) NOT NULL default ‘’, blocked tinyint(4) NOT NULL default 0, KEY ip (ip)
…
$db_desc = “Creating <b>ip2nation</b> table”;
$db_query = “CREATE TABLE " . DB_PREFIX . "ip2nation ( ip int(11) unsigned NOT NULL default ‘0’, country varchar(2) NOT NULL default ‘’, blocked tinyint(4) NOT NULL default ‘0’,
KEY ip (ip);”;