I have 2 Table first is a list of 1 million staff, I have successfully loaded a wildcard search to search through staff. I would like to use results from my wild card search and select the correct staff (using radio buttons or links, I tried with radio buttons)add a comment and this will populate the second table 'recommendations'.
$str = $_POST["search"];
echo $str;
$sql = "SELECT `ID` AS ID,`NAME` AS NAME,GROUP_CONCAT(`ACCOUNT_NO` SEPARATOR ',') AS ACC,FROM cust WHERE `ID` LIKE '%$str%' GROUP BY `ID`";
$result = $conn->query($sql);
$cif1 = "";
echo "<table id='example1' class='table table-bordered table-striped'><th></th><th>NAME</th><th>ID</th><th>ACC</th>";
if($result->num_rows > 0) {
while($row = $result->fetch_assoc()){
echo "<tr><td><input type='radio' id='".$row['ID']."' name='cifq' <?"value='".$row['ID]."'>
<td>".$row['NAME']."</td><td>".$row['ACC']."</td><td>".$row['CIF']."</td></td>";
}echo "</table>";
}
else
{
echo "0 Results";
}
}
I am getting an error when for using the name cifq in $_POST["cifq"] when i try to use the values from the first query in the second.
Please help if you have a better way