I'm trying to extract data from the database. Essence: Get the GET variable (character name), connect to the "characters" base, extract its "char_id" from the variable, connect to the "items" table, and retrieve all the data related to "item_id" and "loc_data" by "owner_id" .. char_id - is in the characters table and has an identical number, like owner_id (but owner_id is in the items table)
public function getCharItem($name){ $db = $this->Connect(self::$_conf['db']); $character = $db->select('characters',array('charId'),array('char_name'=>$name)); $ownerId = ''; $item_list = $db->query("SELECT item_id,loc_data FROM `items` WHERE `owner_id` = ТУТ НУЖНО ПОДСТАВИТЬ CHARID")->fetchAll(); if($item_list !== false and count($item_list) > 0){ foreach($item_list as $key=>$onl){ $ownerId[$key] = array( 'id'=>$onl['item_id'], 'loc_data'=>$onl['loc_data'] ); } if(is_array($ownerId)){ echo $this->XMLRender(array('Characters','Stat','CharBlock'),$ownerId,true); } }else{ echo 0; } } I need to get all items_id by ID and output them in xml. But the output from the array is not correct. I ask for help