Hi, I have already got a hex map working in JS and it writes the coordinates into the hexagons.
[CODE] if (isDebug) {
debugText = col + “,” + row;
}
this.drawHex(currentHexX, currentHexY, “#ddd”, debugText);
What I’m wanting to do is have a MySQL database with the columns, ID, col, row and name. Then instead of having just col and row numbers show inside the hexagons, I would like the name to display from the database if the col + row exist. If no entry with the correct col + row are present in the database then it should just input the col and row numbers as it does now.
Id | Col | Row | Name
1 | 0 | 0 | Bob
2 | 0 | 1 | Fred
3 | 5 | 3 | John
Column 5, Row 3 would display John inside the hexagon. Column 3, Row 5 would display 3,5 inside the hexagon.
Any help in regards to achieving this would be greatly appreciated. My knowledge in JS is quite limited but I do believe it’s not possible to directly interface with MySQL, so I’m stuck.
Cheers