0
I have two darlings:
SELECT Data, NomeDis, AlunID
FROM FaltaDupla
ORDER BY Data, NomeDis, AlunID
SELECT lNum FROM Aula
WHERE lDisciplina =
AND lData =
Derived from a Delphi function. The first is from a Web Bank and while not finishing the second from a Local Bank is executed. How can I generate a JSON that uses both, and for that I will have to make a connection to the web bank and another connection to the local bank?
I tried that way, but I can only perform SELECT from the Web part:
$dsn = "mysql:host=$host;dbname=$dbname;charset=$charset";
$opt =
[
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
PDO::ATTR_EMULATE_PREPARES => false,
];
$pdo = new PDO($dsn, $user, $pass, $opt);
GLOBAL $pdo;
$sql = $pdo->query("SELECT Data, NomeDis, AlunID FROM {$pfx}FaltaDupla ORDER BY Data, NomeDis, AlunID")->fetchall(PDO::FETCH_ASSOC);
echo json_encode($sql);
I did what you said only that now in my local connection it gives this error: Uncaught Pdoexception: SQLSTATE[HY000] [1045] Access denied for user 'USUARIO' (using password: YES). You know why?
– Peter Coast
You can show me an example of how to make a SELECT from a web database and while it is not the end of the web query it makes a local query (from a local bank) and while it is not the end of this local query it checks if it found something and plays in a list and assembles the JSON from that list?
– Peter Coast
This error, in the first comment, says that your user and/or password for the connection are wrong. As for the second comment, I didn’t understand.
– RamonVicente