kazumii Posted June 11, 2021 Share Posted June 11, 2021 Hello, i got a problem with my codes, it says Parse error: syntax error, unexpected token "endwhile" . Please help me, Here's my code: <?php include "connection.php"; if(isset($_POST['submit'])){ $from= $_POST['fromdate']; $to= $_POST['todate']; $result = $conn->query("SELECT * FROM tbl_employee WHERE tbl_hiringdate BETWEEN '$from' and '$to'"); while($rows=mysqli_fetch_array($result)); ?> <tr style="color:white; text-align:center"> <td><?php echo $rows['tbl_id'];?></td> <td><?php echo $rows['tbl_name'];?></td> <td><?php echo $rows['tbl_surname'];?></td> <td><?php echo $rows['tbl_maidenname'];?></td> <td><?php echo $rows['tbl_fathername'];?></td> <td><?php echo $rows['tbl_mothername'];?></td> <td><?php echo $rows['tbl_birthplace'];?></td> <td><?php echo $rows['tbl_bday'];?></td> <td><?php echo $rows['tbl_sex'];?></td> <td><?php echo $rows['tbl_drive'];?></td> <td><?php echo $rows['tbl_marital'];?></td> <td><?php echo $rows['tbl_nationality'];?></td> <td><?php echo $rows['tbl_military'];?></td> <td><?php echo $rows['tbl_disability'];?></td> <td><?php echo $rows['tbl_blood'];?></td> <td><?php echo $rows['tbl_companyname'];?></td> <td><?php echo $rows['tbl_homeaddress'];?></td> <td><?php echo $rows['tbl_homephone'];?></td> <td><?php echo $rows['tbl_mobilephone'];?></td> <td><?php echo $rows['tbl_email'];?></td> <td><?php echo $rows['tbl_profession'];?></td> <td><?php echo $rows['tbl_experience'];?></td> <td><?php echo $rows['tbl_school'];?></td> <td><?php echo $rows['tbl_department'];?></td> <td><?php echo $rows['tbl_hireddepartment'];?></td> <td><?php echo $rows['tbl_hiringdate'];?></td> <td><?php echo $rows['tbl_contactname'];?></td> <td><?php echo $rows['tbl_contactaddress'];?></td> <td><?php echo $rows['tbl_contactphone'];?></td> <td><?php echo $rows['tbl_contactemail'];?></td> <td><?php echo $rows['tbl_relation'];?></td> <td><?php echo $rows['tbl_position'];?></td> <td><?php echo $rows['tbl_jobdescription'];?></td> <td><?php echo $rows['tbl_rate'];?></td> <td><?php echo $rows['tbl_building'];?></td> <td><a href="update.php?id=<?php echo $rows['tbl_id'];?>"><button type="submit" name="update" class="btn btn-dark btn-md">Update</button><br><br> <a href="delete.php?id=<?php echo $rows['tbl_id'];?>"><button type="submit" name="delete" class="btn btn-dark btn-md">Delete</button></td> </tr> <?php endwhile; } ?> Quote Link to comment Share on other sites More sharing options...
requinix Posted June 11, 2021 Share Posted June 11, 2021 while($rows=mysqli_fetch_array($result)); Quote Link to comment Share on other sites More sharing options...
akashmishra Posted June 14, 2021 Share Posted June 14, 2021 (edited) Should be like while (expression) : statement ... endwhile; use : in place of ; in while statement. Edited June 14, 2021 by akashmishra Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.