php simpledb nexttoken 不工作

php simpledb nexttoken not working

我已经阅读了其他 post,例如 pagination in simpledb,但我不太清楚为什么我的代码不起作用。我相信这个问题对我看不到的人来说是显而易见的。

//First I perform a count based on the suggestion in 
$result = $client->select(array('SelectExpression' => "select count(*) from mydomain Where  city='Dallas'"));

//I get back ~ 300 records when I check:$result['Items']['0']['Attributes']['0']['Value'] 

//Next I will query using count for the first 10 records so I can obtain the NextToken.
$result = $client->select(array('SelectExpression' => "select count(*) from mydomain Where city='Dallas' limit 10"));

//This works I see the 'NextToken'
$nexttoken = $result['NextToken'];  

//Now I will fire off my final query this time I would like to use the NextToken
//My goal here is to pick up starting at record 11
$result = $client->select(array('SelectExpression' => "select * from mydomain Where city='Dallas' limit 10"),array('NextToken' => $nexttoken ));

查询成功,但每次都获取到前10条记录。我期待记录 11-20

NextToken 似乎被忽略了。 :-(

我确定这很愚蠢,但我似乎无法让 NextToken 工作。

有什么我搞砸的想法吗?

谢谢

=======================

问题已解决所以我想分享这个以防其他人遇到这个问题。

在 PHP 使用适用于 AWS SDK 的 NextToken 时,您必须创建一个包含查询和下面的 NextToken 示例的数组

$params = array('SelectExpression' => "select * from mydomain WHERE City ='Dallas' LIMIT 10");
$params['NextToken'] = $result['NextToken'];  //Obtained from the count query we ran earlier
$result = $client->select($params);

祝你好运。

问题已解决,所以我想分享这个以防其他人 运行 遇到这个问题。

在 PHP 使用适用于 AWS SDK 的 NextToken 时,您必须创建一个包含查询和下面的 NextToken 示例的数组

$params = array('SelectExpression' => "select * from mydomain WHERE City ='Dallas' LIMIT 10");
$params['NextToken'] = $result['NextToken'];  //Obtained from the count query we ran earlier
$result = $client->select($params);