Im trying to create a dynamic query based upon any or all selections from option values selected by a user. Eg if they select a Project ID a query will return with the project ID, size and a lesson stored in a second table, or If they select a size and department another query would execute. displaying all projects that are of the chosen size with the lessons against it.
Heres what ive got so far. I really could do with some help.
<?php
$pid = $_POST['project_id'] ;
$psize = $_POST['projectSize'] ;
$pdepts = $_POST['depts'] ;
$lstage = $_POST['stage'] ;
$ltype = $_POST['type'] ;
$impacted = $_POST['impacted'] ;
$sqlString = null;
echo "Total Number Of Captured Post Variables is:";
echo count($_POST);
echo '<br />';
$number = 0;
foreach ($_POST as $param_name => $param_val ) {
if ($param_val ==""){
}else{
$number++;
}
echo "Param: $param_name = $param_val<br />\n";
}
if($number ==1) {
}else{
}
?>