Mobile app version of vmapp.org
Login or Join
Looi9037786

: MySQL and SQL inserting data into JavaScript variable! I have a javascript file that has the variable named locations, with some data in quotes for example, 'name', '123 lane', and etc. I

@Looi9037786

Posted in: #GoogleMaps #Javascript #Mysql #Phpmyadmin

I have a javascript file that has the variable named locations, with some data in quotes for example, 'name', '123 lane', and etc. I want the variable to get data from a database and not the plain text. How do I insert the code to do this into my JavaScript variable? I'm new to this, Thanks!!

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Looi9037786

1 Comments

Sorted by latest first Latest Oldest Best

 

@Chiappetta492

It seams like the best way to go about it, is to have a php file which returns the output of your data set; and just make a ajax call to it. Maybe these resources will help:

stackoverflow.com/questions/3288709/load-javascript-array-with-mysql-database-data https://stackoverflow.com/questions/9964799/load-data-from-database-using-javascript stackoverflow.com/questions/17530682/load-info-from-a-db-into-a-javascript-game

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme