I am beginner in PHP I'm trying to generate PDF but I have trouble in how can I display data from selected checkbox. For example I want to select two rows or three or four using this select * from table where id in ($stk)
but its displays blank.
<input type='checkbox' name='stick[]' id="stick" value =' <?php echo $row['id']; ?>' />
$name = isset($_POST['stick'])?$_POST['stick']:NULL;
if(isset($_POST['stick'])){
foreach ($name as $stk){
$query = "SELECT * FROM machine_and_equipments where MENo in($stk)";
$result = mysql_query($query) or die (mysql_error());
while($query_row = mysql_fetch_assoc($result)){
$controlnumber = $query_row['MENo'];
$assetname = $query_row['machine_equipments_name'];
$location = $query_row['Location'];
$text = sprintf("%s\n%s\n%s\n%s\n%s", "Koushin Mechatronics Manufacturing Philippines Inc. ", ' PROPERTY STICKER', 'Control No. : '. $controlnumber .' ', 'Asset Name : '. $assetname .' ', 'Location : '. $location .' ');}