to troubleshoot, add the following code after the <body> tag:
SQL: <?php echo($query_limit_WADAproperties); ?><br />
please send a link where i can see the problem.
instead of pasting the code in your message, please add the php page to a zip archive and attach the zip archive to your message so I can see the entire page code in context.