Is something wrong with the syntax of this query? I'm using mysql and PHP.
$stmt = $conn->query("SELECT denominazione
FROM tab02_impianti
WHERE tab02_impianti.cod_impianto = tab05_workgroup.cod_impianto
AND tab05_workgroup.cod_utente = tab01_utenti.cod_utente ");
Because I get the error:
Fatal error: Uncaught Error: Call to a member function fetch() on boolean in...
The error show up because of the WHERE sentence. It works without it but I get all the data of the table. So this part: "SELECT denominazione FROM tab02_impianti" should be ok.
I cant figure it out, can I get some help please? Thank you very much :)
Let me write something more: I have users table (tab01) and industrial installations (tab02). Every user can be related to more installations and vice versa. The tab05, workgroup, contain the id of both. I just want to show to the user the information about the industrial installations that he is allowed to.