select_command

Questionsselect_command
Jorge Reis asked 9 years ago

This work fine

$grid->select_command = "
SELECT DISTINCT a.id,
a.nome,
a.actividade,
(SELECT COUNT(*) FROM antp_pub_empresas_contactos b WHERE b.empresa_id = a.id) n_contactos
FROM
antp_pub_empresas a
WHERE a.id > 0
AND a.id NOT IN (SELECT c.empresa_id FROM antp_pub_empresas_conversacoes c WHERE c.pessoa_antp = 43)";

But this does not

$flt = " AND a.id NOT IN (SELECT c.empresa_id FROM antp_pub_empresas_conversacoes c WHERE c.pessoa_antp = 43) ";
$grid->select_command = "
SELECT DISTINCT a.id,
a.nome,
a.actividade,
(SELECT COUNT(*) FROM antp_pub_empresas_contactos b WHERE b.empresa_id = a.id) n_contactos
FROM
antp_pub_empresas a
WHERE a.id > 0 $flt";

WHY???

1 Answers
Jorge Reis answered 9 years ago

Solved. I had to change from POST to Get the method of the form where I have the controls with filter elements to pass to select_command

Your Answer

17 + 17 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?