Topic: Spreadsheet to MySQL - correct syntax for URLs?
Trying to export from ods spreadsheet into mysql via phpmyadmin
[code=sql]
="INSERT INTO `spamurls` VALUES ("&A2&","&B2&","&C2&","&D2&","&E2&","&F2&""&");"
[/code]
like this; but 2 probs
1. Date is not in date format?
2. [code]://[/code] causes problem - any idea how to solve?
[code=sql]
INSERT INTO `spamurls` VALUES (2,http://www.mindmagiclive.com/,magicians toronto ,1,40409,S);
INSERT INTO `spamurls` VALUES (3,http://mobilemonopolyreview.easyonlinejobsreview.com/,mobile monopoly review ,1,40409,S);
INSERT INTO `spamurls` VALUES (4,http://doubleglazingleeds.org,double glazing leeds ,1,40409,S);
INSERT INTO `spamurls` VALUES (5,http://www.wordsworth.co.uk,industrial PC ,1,40409,S);
INSERT INTO `spamurls` VALUES (6,http://www.cheapipodnano.org,Cheap iPod Nano ,1,40409,S);
INSERT INTO `spamurls` VALUES (7,http://www.semenaxsale.com,semenax review ,1,40409,S);
[/code]
this is original code in spreadsheet:
[code]
2 http://www.mindmagiclive.com/ magicians toronto 1 19.08.10 S
3 http://mobilemonopolyreview.easyonlinejobsreview.com/ mobile monopoly review 1 19.08.10 S
4 http://doubleglazingleeds.org double glazing leeds 1 19.08.10 S
5 http://www.wordsworth.co.uk industrial PC 1 19.08.10 S
6 http://www.cheapipodnano.org Cheap iPod Nano 1 19.08.10 S
7 http://www.semenaxsale.com semenax review 1 19.08.10 S
[/code]
The SQL I used to create table
[code=sql]
CREATE TABLE `spamurls` (
`id` int(11) NOT NULL auto_increment,
`url` varchar(150) NOT NULL default '',
`keyword` varchar(100) NOT NULL default '',
`position` varchar(4) NOT NULL default '',
`date` varchar(12) NOT NULL default '',
`type` varchar(25) NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM
[/code]
Error I'm getting
[code=sql]
#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 '://www.mindmagiclive.com/,magicians toronto ,1,40409,S)' at line 1
[/code]