1. $readTime _rank_result=m (' blog ')->order (' Breadtime DESC ')->limit (3)->select ():
A. The return value is a dataset, which can be output in the foreground using the following method:
<volist name= "Readtime" id= "R" >
{$r. Id} nbsp; {$r. Time} </br>//or: {$r [' Id ']} nbsp; {$r [' Time ']}
</volist>
You can also use the loop output:
<foreach name= "Readtime" item= "R" >
{$r. Id} nbsp; {$r. Time} </br>//or: {$r [' Id ']} nbsp; {$r [' Time ']}
</foreach>
The two cycle methods are identical;
B.thinkphp does not support the top () method in SQL, but the built-in limit function can do the same thing.
2. Differences in output methods:
Echo: A single character, string for the input, no output array, no data set, only one output: array; (PHP method)
Var_dump: Printing of long, variable and array, automatically formatted; (PHP method)
Print_r: With Var_dump;
3. In thinkphp, all hyperlink jumps are best implemented using the U function, the format is: U (' Controller name/method name '), if the method is in the controller of this page, then can be written directly to U (' method name ');