All right now, here is the database solution for you:
Table paths will store the paths you have, from your array.
CREATE TABLE `gmap`.`paths` (
`pID` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
`pName` VARCHAR(75) NOT NULL,
`pStartLat` VARCHAR(25) NOT NULL,
`pStartLng` VARCHAR(25) NOT NULL,
`pAverageSpeed` FLOAT NOT NULL,
PRIMARY KEY (`pID`)
)
ENGINE = MyISAM;
Table paths will store your user/path name (whatever you want) in pName field, starting point in pStartLat/pStartLng fields, pAverageSpeed is of course average speed (don't know if you want it, just in case) and pID is identifier which you will use with another table:
CREATE TABLE `gmap`.`coords` (
`cID` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
`cLat` VARCHAR(25) NOT NULL,
`cLng` VARCHAR(25) NOT NULL,
`cSpeed` FLOAT NOT NULL,
`cPath` INTEGER UNSIGNED NOT NULL,
PRIMARY KEY (`cID`)
)
ENGINE = MyISAM;
This table will let you store coordinates - with speed to each one.
Now, let's say you want to show path called 'TestOne'.
// Connect to the database - I assume you can do that
// and retrieve data
SELECT * FROM paths WHERE pName = "TestOne"
Now you got ID, name, starting point coordinates and average speed in table (mysql_fetch_assoc would be great for that).
Then, using the ID you can retrieve the rest of the coordinates:
SELECT * FROM coords WHERE cPath = ID
And now, using e. g. while loop, you can retrieve all coordinates into an array.
Of course first you have to store that data using INSERT INTO construction or similar :-)