For detailed solution to the function code, please help explain the code below in detail
Public function fetch_all_by_ SQL ($ where, $ order = '', $ start = 0, $ limit = 0, $ count = 0, $ alias = '')
{
$ Where = $ where &&! Is_array ($ where )? "WHERE $ where ":'';
If (is_array ($ order )){
$ Order = '';
}
If ($ count ){
Return DB: result_first ('SELECT count (*) from '. DB: table ($ this-> _ table ). '% I % I '. DB: limit ($ start, $ limit), array ($ alias, $ where, $ order ));
}
Return DB: fetch_all ('select * from '. DB: table ($ this-> _ table ). '% I % I '. DB: limit ($ start, $ limit), array ($ alias, $ where, $ order ));
}
Reply to discussion (solution)
You can mark it out.
I don't know.
Public function fetch_all_by_ SQL ($ where, $ order = '', $ start = 0, $ limit = 0, $ count = 0, $ alias = '')
A database search function that returns the total number
Parameter: $ where is the same as SQL WHERE
$ Order is the same as SQL ORDER
$ Start: which record does the SQL statement start to return?
$ How many records are returned by limit?
$ Count: whether to directly return the number of search results
Alias doesn't quite understand what the role is.
I don't just see a reply to the story
Upstairs + 1