if(!$_GET){
echo "{'success':false, 'error':'No query parameters submitted'}";
return;
}
// 1. Include the SimpleDB class if it does not exist
if (!class_exists('SimpleDB'))require_once('sdb.php');
// 2. Set awsAccessKey and awsSecretKey to your values
require_once('config.inc.php');
// create connection
$sdb = new SimpleDB(awsAccessKey, awsSecretKey);
$condition = "";
$status = "";
//$params = json_decode(stripslashes($_POST['hash']));
$params = $_GET;
foreach($params as $key => $value){
$condition .= " " . $key . " = '" . $value . "' and" ;
}
$condition = preg_replace('/and$/', "", $condition);
$query = "select * from $domain";
if($condition!= " _empty_ = '' "){
$query .= " where $condition ";
}
$fileHash = '{';
if($files = $sdb->select($domain, $query)){
$status = 'true';
$fileHash .= "'files' : ".json_encode($files).", ";
}else{
$status = 'false';
$fileHash .= "'files' : [], ";
$fileHash .= "'error' : 'No records retrieved from SimpleDB ".json_encode($sdb->ErrorCode)."', ";
}
$fileHash .= "'success':".$status."}";
echo $fileHash;
мой ответ json {'files': [{"Name": "4cf0dadfddfe6", "Attributes": {"title": "Earrings!", "File_size": "135023"," url ":" http: \ / \ / dtzhqpwfdzscm.cloudfront.net \ /4cf0dadfddfe6.jpg "," file_name ":" 4cf0dadfddfe6.jpg "," time_stamp ":" 1290853092 "," file_type ":" image \/ jpeg "," content_obj_type ":" upload "," thumb ":" http: \ / \ / dtzhqpwfdzscm.cloudfront.net \ /4cf0dadfde32b.jpg "," width ":" 176.04166666666669 "," height ":" 171 ", "userid": "4", "gibid": "54", "contentid": "4cf0dadfddfe6", "qqfile": "il_570xN.182320055.jpg", "original_name": "il_570xN.182320055.jpg", "y ":" 72 "," x ":" 535 "," on_floor ":" false "," success ":" true "," gibview ":" O "," avatar_url ":" "," crop_url ":""}}], 'success': true}
Я хочу отсортировать по time_stamp, как я могу это сделать.?или любую хорошую статью для изучения базы данных s3, пожалуйста, предложите.