Connecting to a SQLite database hosted in Google Drive with PHP

I think that says it all. Since PHP5, we have many methods for processing SQLite data. Now I have uploaded the SQLite file to the Google Drive folder and have given read / write access to everyone. Now I can connect to this database file from PHP using functions like:

$dbconn = sqlite_open($googleDriveLink); // or
$db = new SQLite3($googleDriveLink);

      

+3


source to share


2 answers


Read and write access in the context of google drive means "read and write using their user interface or APIs", on the other hand PHP needs "operating system write and write access" to the file. Google does not expose the file to the file in such a way that SqLite can process it. The best thing that can be a complicated way you can get is to download and upload it, but it will collide with others and will not be useful.



+4


source


You might want to educate yourself in the Google Drive help system, specifically the section on files .

You can pass the download url to it as I assume what you mean by $googleDriveLink

, but I don't think what you are looking for. Say, for example, the privacy settings in the file are changed, which prevents anonymous downloads.

To take advantage of the Google Drive APIs in PHP, you need to use an HTTP client in your code that handles communication, or creates a backend that uses your PHP code. It might be helpful to read the google API client library .



Whichever path you choose, you will most likely have to upload the SQLite file to your PHP server and manage it locally, then optionally update it in Google Drive .

Hope it helps.

+3


source







All Articles