Error loading multiple values on a SQL Table Google Maps

好久不见. 提交于 2020-01-06 19:38:11

问题


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

  1. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!