how to use a php varibale (say $age) in WHERE clause in the custom sql query
myquery is $g->select_command = "SELECT name,age,sex FROM children WHERE age=$age";
this causes error
pls help me
1 Answers
Pasting from FAQ: Q) How to load grid based on $_POST data from other page.
Solution is to put the POST variable in session and use it from session for WHERE clause..
e.g.
if (!empty($_POST["personid"]))
{
$_SESSION["personid"] = $_POST["personid"];
}
$pid = $_SESSION["personid"];
and use `$pid` in your SQL.
Your Answer