That is a MySQL style loop. Since you are using MySQLi now on the page it has to be updated to the correct MySQLi syntax. I've done that for you on the page. I just applied the MySQLi repeat region and updated the column references to use the MySQLi syntax.