Ah, of course! However I moved it and tried again, and it's now giving the following error:
Fatal error: Uncaught Error: Cannot use object of type WA_MySQLi_RS as array in /var/www/xxx/mysite.com/xxx/pagename.php:38 Stack trace: #0 {main} thrown in /var/www/xxx/mysite.com/xxx/pagename.php on line 38. I've attached my updated page.