Hi,
I have tried a query and works fine, I need to load grid based in post value from other page in comparison value into query. this is my query:
SELECT
`demo_candidatos`.`demo_eleccion_ideleccion` AS `Ideleccion`,
`demo_candidatos`.`idcandidatos` AS `Idcandidatos`,
`demo_candidatos`.`nombre` AS `Candidatos`,
`demo_candidatos`.`numero` AS `Numero_Tarjeton`,
`demo_candidatos`.`tarjeton` AS `tarjeton`
FROM
(`demo_candidatos`
JOIN `demo_eleccion`,`demo_voting`)
WHERE
((`demo_eleccion`.`ideleccion` = `demo_candidatos`.`demo_eleccion_ideleccion`)
AND (`demo_eleccion`.`estado` = 'Abierto') AND (`demo_eleccion`.`ideleccion` = `_POSTVAR`)AND
(`demo_eleccion`.`ideleccion` = `_POSTVAR`)AND
(`demo_eleccion`.`ideleccion` = `_POSTVAR`))
GROUP BY `demo_candidatos`.`idcandidatos`
Thanks!
To use POST data in query, you need to persist them in session first.
e.g.
if (!empty($_POST["personid"]))
{
$_SESSION["personid"] = $_POST["personid"];
}
$pid = $_SESSION["personid"];
and use `$pid` in your SQL.
In case you are facing some query error after, you can send database test dump on [email protected] to regenerate case.