Thanks ray.. I had to make a slight adjustment to your code. there was one to may parentheses being used. so I tried the following:
if (isset($_POST["submit-consent-s"]) && $rsConsLeaseholders->getColumnVal("total_flats") <= 10) {
This now works fine.
Many thanks: