print "Query error: " . $wsql->error; exit; } // fetch all results as objects: foreach ($wsql->fetch_objects() as $obj) { // create a new htmlsql object: $sub_wsql = new htmlsql(); // connect to the <item> content: $sub_wsql->connect('string', $obj->text); // fetch all attributes of all tags: if (!$sub_wsql->query('SELECT * FROM *')) { print "Query error: " . $wsql->error; exit; } // this "special" function converts tagnames to keys $sub_wsql->convert_tagname_to_key(); /* this function converts an array that looks like this: $array[0]['tagname'] = 'title'; $array[0]['text'] = 'example 1'; $array[1]['tagname'] = 'link'; $array[1]['text'] = 'http://www.example.org/'; $array[2]['tagname'] = 'description'; $array[2]['text'] = 'description bla'; $array[2]['fulltext'] = '1'; // additional attribute -> to: $array['title']['text'] = 'example 1';