SpeedPHP中,spModel中的LIMIT如何写?

#1 zf19870131

function index(){
$times = spClass("times");
$times->create(array("time"=>date("Y-m-d H:m:s", time()+8*3600)));
$result = $times->findAll("","id","10");
echo $times->dumpSql();
echo "
";
foreach ( $result as $value) {
echo $value['id']." — (".$value['time'].")
";
}
}


这样写总是出错。

在limit总是出问题。

报错代码是:
3.
{
4.
function index(){
5.         $writeurl = spUrl("main", "write");
6.         $times = spClass("times");
7.         $times->create(array("time"=>date("Y-m-d H:m:s", time()+8*3600)));
8.         $result = $times->findAll("","id","10");


9.
echo $times->dumpSql();
10.
echo "
"
;
11.
foreach ( $result as $value) {
12.
echo $value['id']." — (".$value['time'].")
"
;
13.
}

2010-04-17 21:29:41

#2 zf19870131

哦,刚刚看了一下手册,发现少看一个参数。

想问一下,findAll中
第三个参数是做什么用的?
array findAll(mixed conditions, string sort, string fields, string limit)

2010-04-17 21:35:43

#3 zf19870131

现在明白了

2010-04-17 21:38:34

#4 zf19870131

是字段名次。

2010-04-17 21:38:52