Fixed #3833 Undefined variable: sql_limit_to_append.
Initialized the varible sql_limit_to_append,
Since isset($x) returns true when $x=''(which is not the expected behaviour of the usage), used the function empty()
Fixed coding style issue
Merge pull request #177 from hisamith/limit_error_3833

Fixed #3833 Undefined variable: sql_limit_to_append.