IF 2 checkboxes in the same field are checked

3 posts by 2 authors in: Forums > CMS Builder
Last Post: December 17, 2008   (RSS)

Hi guys,

I have a situation with a checkbox field called course_type. For 95% of the hospitality courses in the database, I just present the result of this checkbox selection:

<?php echo $hospitalityRecord['course_type'] ?>

We have a rare situation that if the checkbox "Post Secondary Courses" AND "International Student Courses" are selected, we would like it to display "This course is available to both Local & International Students"

I started mucking around with it and got this far:

<?php if ($hospitalityRecord['course_type' = "Post Secondary Courses" and "International Student Courses"]): ?>
This course is available to both Local & International Students

else <?php echo $hospitalityRecord['course_type'] ?>
<?php endif ?>


Are you able to assist with the correct code?

Thanks,

Benedict

Re: [Dave] IF 2 checkboxes in the same field are checked

Works perfectly. Thanks, mate - you're the man.