Or, to cut things down a bit:
Or, even more:
PHP Code:
$Query = "SELECT column, anothercolumn FROM table WHERE cu.clubid = '{$clubid}'";
if($hcpgroup != 0){
$Query.= " AND u.h_index >= '{$hcpgroup_start}' AND u.h_index <= '{$hcpgroup_end}'";
}
$Query.=" ORDER BY ecl.st_total ASC";
PHP Code:
$Query = SPrintF("SELECT column, anothercolumn FROM table WHERE cu.clubid = '%s' %s ORDER BY ecl.st_total ASC", $clubid, ($hcpgroup > 0) ? "AND u.h_index >= '{$hcpgroup_start}' AND u.h_index <= '{$hcpgroup_end}'" : '');
Bookmarks