我一直在使用AMFPHP和flash进行项目。我只做了php的东西。 amf中的一个函数,它从3个表中得到结果,并将结果存储在1个数组中,并且返回工作正常,但几天后它已经停止了。奇怪的是,如果我单独返回结果它们可以工作,但最终的数组永远不会返回,并且无法在其测试浏览器中看到AMFPHP调用的任何响应。
在我提到的代码中,每一点都得到了DB的正确结果,并从中正确地测试了它的重新调整结果。
另一件事似乎很奇怪,我返回的部分结果很好,但是在他开始和结束的时候,其他功能都不适用于其他功能:
(mx.collections::ArrayCollection)#0
filterFunction = (null)
length = 6
list = (mx.collections::ArrayList)#1
length = 6
source = (Array)#2
RESULT
uid = "8BEDEF32-4BED-E1A4-56A0-F227EDD40026"
sort = (null)
source = (Array)#2
这是函数
function getDefaultValuesForAvatarsLocal($jockey_type=NULL){
$defaultValues = array();
$sql = "SELECT * FROM default_values";
$defaultBLValues = $this->db->query($sql);
$numRows = $this->db->num_rows($defaultBLValues);
if($numRows > 0){
$defaultValues['BLP'] = $defaultBLValues; /* IF RETURN THIS GETS RESULT */
if($jockey_type){
$sql = "SELECT jockey_clothing_categories.type, jockey_clothing_items.* FROM jockey_clothing_items
JOIN jockey_clothing_categories
ON(jockey_clothing_items.category_id = jockey_clothing_categories.id)
WHERE jockey_clothing_items.is_default = 1 AND jockey_clothing_items.jockey_type = ". $jockey_type;
$defaultJockeyClothings = $this->db->query($sql);
$numRows = $this->db->num_rows($defaultJockeyClothings);
}
if($numRows>0){
if($jockey_type){
$defaultValues['DJC'] = $defaultJockeyClothings; /* IF RETURN THIS GETS RESULT */
}
$sql = "SELECT horse_avatar_clothings_categories.type, horse_avatar_clothings_items.* FROM horse_avatar_clothings_items
JOIN horse_avatar_clothings_categories
ON(horse_avatar_clothings_items.category_id = horse_avatar_clothings_categories.id)
WHERE horse_avatar_clothings_items.is_default = 1";
$defaultHorseClothings = $this->db->query($sql);
$numRows = $this->db->num_rows($defaultHorseClothings);
if($numRows>0){
$defaultValues['DHC'] = $defaultHorseClothings; /* IF RETURN THIS GETS RESULT */
#return $defaultValues; /* NOT RETUNING THE FINAL ARRAY FROM THIS POINT EITHER */
}else{
# return false;
}
}else{
# return false;
}
#return 1333;
/* THE CONTROL COMES HERE PROPERLY BUT NOT RETUNING THE BELOW ARRAY BUT IS RETUNING ANY TEST TEXT
LIKE return "I AM HERE"; WILL RETURN THE TEXT PROPERLY
*/
return $defaultValues;
}else{
return false;
}
}
任何帮助将不胜感激 Reagrds
答案 0 :(得分:1)
好吧,我得到了答案..
只需在面向同一问题的任何人发布
刚刚修改了一行
return $defaultValues;
到
return (object)$defaultValues;
并调用了这样的函数
$defaultValues = (array)$this->getDefaultValuesForAvatarsLocal();
不知道为什么这些更改正常工作,因为它在过去没有任何更改时正常工作。如果有人能够解释这对我和周围的任何其他用户都很好。
此致