Hello.
In my “TestApp” I have a remote mySql database. From some tutorial I have a PHP script like this:
<?php
$servername = "sql.***.it";
$username = "***";
$password = "***!";
$dbName = "***";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbName);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$conn->set_charset("utf8mb4"); // Impostiamo la codifica corretta
$sql = "SELECT ID, Domanda, Esatta, Errata1, Errata2, Errata3, Immagine, Url_Audio, Url_Immagine FROM Table1"
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo "ID".$row['ID'] .
"|Domanda" . $row["Domanda"] .
"|Esatta" . $row["Esatta"] .
"|Errata1" . $row["Errata1"] .
"|Errata2" . $row["Errata2"] .
"|Errata3" . $row["Errata3"] .
"|Immagine" . $row["Immagine"] .
"|Url_Audio" . $row["Url_Audio"] .
"|Url_Immagine" . $row["Url_Immagine"] .
";";
}
} else {
echo "0 results";
}
$conn->close();
?>
Now. I have other similar tables (same structure, different data). Is it possible to read from two (or more, maybe ALL) tables? Data is then stored in LISTS in unity.
if I use this code:
$sql = "SELECT ID, Domanda, Esatta, Errata1, Errata2, Errata3, Immagine, Url_Audio, Url_Immagine FROM Table1, Table2"
It give me “0 results”. Of course if I just type in Table1 or Table2 … it works!
Thank for your help!