I have looked everywhere for a way to update a Google Fusion table using an UPDATE query from a javascript. All I need to do is update one column with an array that is generated from the code itself, after the fusion table information is read and processed. I do not need the user to update the table.
Is there a way to do this using Javascript alone? Or do I really need a combination of OAuth 2.0 and php? Is there a working example of this? All I find is extremely vague or fragmentary.
Thank you.
Yes you need OAuth 2.0 and some kind of server-side code (like PHP). If you don't need the user to update the table, I guess that you are using Fusion Tables as some kind of central database for your application.
For this purpose (i.e. without the user being involved), Google provides so called Service Accounts. If you use such a service account, you can simply give access to your table to this account and then you are able to update the table via server-side code. The PHP OAuth library from Google supports service accounts and is quite easy to use.
If you want to use as much JavaScript code as possible you could provide an interface to the PHP OAuth library to your JavaScript code (see my answer to a similar question for more details). Otherwise just defer the UPDATE
statement to the PHP code and you're fine.