in an application type grid with database Mysql this query
SELECT sc.Codice,sc.Descrizione,
(SELECT COUNT(*) FROM Magaz m WHERE m.CodSito=sc.Codice)AS numdis
FROM SitCli sc
WHERE sc.CodCliente>0
using the field ‘numdis’ as search field appears the error:
SIZE=12px: select distinct numdis from (SELECT sc.Codice,sc.Descrizione, (SELECT COUNT() FROM Magaz m WHERE m.CodSito=sc.Codice) AS numdis FROM SitCli sc WHERE sc.CodCliente>0 ) nm_sel_esp where distinct numdis = ‘1’ [/SIZE] [HR][/HR][SIZE=12px]Query: select distinct numdis from (SELECT sc.Codice,sc.Descrizione, (SELECT COUNT() FROM Magaz m WHERE m.CodSito=sc.Codice) AS numdis FROM SitCli sc WHERE sc.CodCliente>0 ) nm_sel_esp where distinct numdis = ‘1’ failed. You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘distinct numdis = ‘1’’ at line 1[/SIZE]
[SIZE=12px]1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘distinct numdis = ‘1’’ at line 1[/SIZE]
ADOConnection._Execute(select distinct numdis from (SELECT sc.Codice,sc.Descrizione, (SELECT COUNT() FROM Magaz m WHERE m.CodSito=sc.Codice) AS numdi…, false)[SIZE=-1] % line 1095, file: adodb.inc.php[/SIZE] ADOConnection.Execute(select distinct numdis from (SELECT sc.Codice,sc.Descrizione, (SELECT COUNT() FROM Magaz m WHERE m.CodSito=sc.Codice) AS numdi…)[SIZE=-1] % line 2341, file: test_264_pesq.class.php[/SIZE] test_264_pesq.monta_form()[SIZE=-1] % line 86, file: test_264_pesq.class.php[/SIZE] test_264_pesq.monta_formulario()[SIZE=-1] % line 75, file: test_264_pesq.class.php[/SIZE] test_264_pesq.monta_busca()[SIZE=-1] % line 2141, file: index.php[/SIZE] [TABLE=“class: scErrorTable, align: center, cellpadding: 0, cellspacing: 0, width: 0, height: 30”]
[TR]
[TD=“class: scErrorTitle, bgcolor: #FFF154, align: left”]Errore[/TD]
[/TR]
[TR]
[TD=“class: scErrorMessage, bgcolor: #FFF154, align: center”]Errore durante l’accesso alla banca dati:
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘distinct numdis = ‘1’’ at line 1
select distinct numdis from (SELECT sc.Codice,sc.Descrizione, (SELECT COUNT(*) FROM Magaz m WHERE m.CodSito=sc.Codice) AS numdis FROM SitCli sc WHERE sc.CodCliente>0 ) nm_sel_esp where distinct numdis = ‘1’[/TD]
[/TR]
[/TABLE]