问题
I'm with a project on Google maps, that I want to save routes and Waypoints on a map, the problem is that I can sabe the routes on the database, but can't load all of them on the map, I can only load one Route, and I want to load multiple routes.
For you undertand access this example:
Click on the map to create the start point, and click again to create the end point, them, click on save waypoints This is my codes
index.htm
This is a print of my table
OBS: This is only a part of my code, to see the full code, please enter on the links that I sent and see the Source pressing CTRL+U
I really need help, I'm trying for one month on the same problem !
回答1:
There are many 'errors' causing the problem
- Database structure
1.1 Your table has only 1 field(column) holding all the data
1.2 As there is only 1 field how do you differentiate between routes?
At the the very least you should have at least 2 fields id(preferably autocomplete)and value. Allthough preferably you should have a field for each attribute.
2. $rs = mysql_fetch_array($res,1);
The second parameter should be the type of array that is to be fetched. It's a constant and can take the following values: MYSQL_ASSOC, MYSQL_NUM, and MYSQL_BOTH. see php manual
As this parameter is not required try $rs = mysql_fetch_array($res);
3. Instead of
$query = "insert into inventoresdegara set value='$data'";
Try
$query = "INSERT INTO inventoresdegara VALUE('$data')";
I would suggest you read up on using PHP/MySQL w3 school
来源:https://stackoverflow.com/questions/12203187/error-loading-multiple-values-on-a-sql-table-google-maps