Welcome Guest, Not a member yet? Register   Sign In
[PROBLEM SOLVED] Is my condition correct? (keyword & country field)
#3

[eluser]PhilTem[/eluser]
You may want to make the $keyword and $country argument optional or set it to an initial value like

Code:
function frontpage_records($per_page, $keyword = '', $country = 'all') {
  // your code
}

Then it should work as expected.

PS: Furthermore you should not make the limit option dependent on an URI-segment but have it rather as an additional argument to your method

Code:
function frontpage_records($country = 'all', $keyword = '', $per_page = FALSE, $offset = FALSE) {
  // your code with the appropriate logic on $per_page and $offset of course ;) like setting some default values if $per_page or $offset is empty or not use $db->limit() if either parameter is not set
}


Messages In This Thread
[PROBLEM SOLVED] Is my condition correct? (keyword & country field) - by El Forum - 06-30-2012, 09:12 AM



Theme © iAndrew 2016 - Forum software by © MyBB