Unanswered: hardcoding a db-creation process or not: what is more flexible?
Hello dear db-experts - good day.
note; i run linux opensuse 13.1
the final goal is to get stored some xml-files in a mysql-database.
thats what i am looking for. - the xml-files are derived from a osm-request - at a OpenSteetpmap-api. and thats why i am here. Guess that you are good php and mysql-experts
well i play around with some openstreetmap-requests - and want to store the results in a Mysql-db.
see the tags:
id lat lon name amenity operator vending
see the table 'pois' that i want to create - and subsequently create some columns
see the SQL-Script
CREATE DATABASE `db123` DEFAULT CHARACTER SET latin1 COLLATE latin1_german2_ci;
CREATE TABLE `pois` (
`id` BIGINT(20) UNSIGNED NOT NULL,
`lat` FLOAT(10,7) NOT NULL,
`lon` FLOAT(10,7) NOT NULL,
`name` VARCHAR(255) COLLATE utf8_bin NOT NULL,
`amenity` VARCHAR(255) COLLATE utf8_bin NOT NULL,
`operator` VARCHAR(255) COLLATE utf8_bin NOT NULL,
`vending` VARCHAR(255) COLLATE utf8_bin NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
first of all i thought that i can do the db creation with some hard coded methods: but instead of hard-coding the required column names as in
note: to get the output - just press the button in the top-menu called "Ausführen"
after this you press the button called "DATEN" on the top-right -
just below the green button called "flatter this": after pressing this "DATEN"-button you see the data in the right window of the screen.
note - it has got various ids - that means that the osm-file does not give back constantly all the tags...
the last question; does this make any problems to our project - does this has any influence on our db-connection...!?!?
the second one is regarding the variations in the mysql.txt - file
- i.e. the different number of tags.; How to make the script robust so that
it is able to work with this - and does not stopt to work....!?
well i hope i was able to make clear what i want to achieve:
can i use the code snippet to create the db table -
we could use this to pick up any additional columns added to your pois table