In my Google Drive Storrage I have a database (SQL file) which I want to read out from a PHP file on my webserver. The database looks like this:
DB_Name: Test
TBL_Name: Namen
| id | Vorname | Nachname |
-----------------------------
| 1 | Max | Mustermann |
| 2 | Hanz | Peter |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Now I tried to connect to the SQL file with this basic PHP code:
$verbindung = mysql_connect($driveLink, "", "")
or die("Failed to create connection.");
mysql_select_db("Test")
or die ("The database does not exists.");
$abfrage = "SELECT Vorname FROM Namen";
$ergebnis = mysql_query($abfrage);
while($row = mysql_fetch_object($ergebnis))
{
echo "$row->Vorname";
}
But I can't get a connection to the file. Why is that? I have not set a username or password for the database so I pass empty strings to it, right? Also I gave the file access to everyone so I can reach the file from my code.
Is that because there is no underlying system like PhpMyAdmin or something else? How can I connect to the database from PHP?