Sorry, I am not fully understanding the problem. Perhaps it is because I am reading this post on my mobile phone.
Are you getting an error message in the log file? If so, please post it? Or are you seeing an HTML formatting issue?
---------- Post updated at 07:56 ---------- Previous update was at 03:07 ----------
OBTW (back on my desktop computer), this statement does not look right, or it is not how I would write it:
PHP Code:
$query = "SELECT venue, SUM(amount) FROM IWD WHERE venue='$sel_venue'";
I would write this:
PHP Code:
$query = "SELECT venue, SUM(amount) FROM IWD WHERE venue=".$sel_venue;
or
PHP Code:
$query = "SELECT venue, SUM(amount) FROM IWD WHERE venue=$sel_venue";
in PHP, single quotes means "take what is inside literally and do not expand". Double quotes means "expand the variables inside". When you mix single and double quotes (inside each other) you can have huge problems in PHP.
Better for this, and considered the least confusing is:
PHP Code:
$query = 'SELECT venue, SUM(amount) FROM IWD WHERE venue='.$sel_venue;
The reason for this is that 'SELECT venue, SUM(amount) FROM IWD WHERE venue=' does not require any variable expansion inside the single quotes.