我正在使用amazon api并使用来自在线资源的代码http://www.codediesel.com/php/accessing-amazon-product-advertising-api-in-php/.
当我使用amazon api进行搜索查询时,我想获得超过10个产品的详细信息.我知道每次调用获得10个数据的amazon api策略,但是可以通过创建循环或其他东西获得更多数据吗?
当我提出请求时,我已经分配了以下参数
$parameters = array("Operation" => "ItemSearch",
"SearchIndex" => "Electronics",
"ResponseGroup" => "Images,ItemAttributes,EditorialReview,Offers ",
"ItemPage"=>"10",
"Keywords" => $search );
Run Code Online (Sandbox Code Playgroud)
因此,即使我要求10页的结果,我不确定如何显示每个页面(1到10)的数据,所以总共我得到100个项目,当我进行查询.当我尝试运行代码时,我得到以下响应:
SimpleXMLElement Object (
[Request] => SimpleXMLElement Object (
[IsValid] => True
[ItemSearchRequest] => SimpleXMLElement Object (
[ItemPage] => 10
[Keywords] => laptop
[ResponseGroup] => Array (
[0] => Images
[1] => ItemAttributes
[2] => EditorialReview
[3] => Offers
)
[SearchIndex] => Electronics
)
)
[TotalResults] => 3383691
[TotalPages] => 338370
[MoreSearchResultsUrl] => http://www.amazon.co.uk/gp/redirect.html?camp=2025&creative=12734&location=http%3A%2F%2Fwww.amazon.co.uk%2Fgp%2Fsearch%3Fkeywords%3Dlaptop%26url%3Dsearch-.................(and on) …Run Code Online (Sandbox Code Playgroud) 我正在尝试开发我的网站,需要一些支持.因此,我的网页搜索产品的信息并返回适当的结果.当用户在搜索框中搜索关键字或产品标题并提交查询但现在获得的结果列表时,我的工作完全正常,我想要一个过滤搜索用户可以根据价格,品牌,类别等过滤搜索结果.
我在mysql数据库1中有两个表:product_info,列有productid,标题,描述,品牌,类别,价格2:product_image productid,imageid,imagename,image
请帮助我,我应该从这个过程开始.我已经看过网络,他们有多个建议使用哪个脚本,但我想使用最简单的方法,因为我是这一切的新手.你可以推荐任何与此话题相关的内容.谢谢你:)
只是为了让您知道,对于单个搜索框,我使用了以下代码.
$query= "
SELECT *
FROM `product_info`
WHERE `title` LIKE '% ".$search_name." %'
OR `title` LIKE '% ".$search_name."'
OR `title` LIKE '".$search_name." %'
OR `title` = '".$search_name."'";
$query_run=mysql_query($query);
if(mysql_num_rows($query_run)>=1)
{
echo'Showing '.mysql_num_rows($query_run).' results for items with "'.$search_name.'" in the title:';
//the result is displayed in the table format.
}
Run Code Online (Sandbox Code Playgroud)