like was mentioned already, line 34:
}if (!function_exists("GetSQLValueString")) {
needs to be changed to:
if (!function_exists("GetSQLValueString")) {
also your SQL Statement does not include the tournamentcategories.CategoryName column.
this needs to be added to the select statement, the change the code that is echoing the category ID:
<?php echo $row_WADAtournaments['CategoryID']; ?>
to use the category name column:
<?php echo $row_WADAtournaments['CategoryName']; ?>
note, my examples use the CatagoryName as the column name, If yours is different, you will need to make the necessary adjustments.