getParam(0)); $dbh = dba_open("/tmp/comments.db", "r", "db2"); if ($dbh) { $countID = "${msgID}_count"; if (dba_exists($countID, $dbh)) { $count = dba_fetch($countID, $dbh); for ($i = 0; $i < $count; $i++) { $name = dba_fetch("${msgID}_name_${i}", $dbh); $comment = dba_fetch("${msgID}_comment_${i}", $dbh); // push a new struct onto the return array $ra[] = array( "name" => $name, "comment" => $comment, ); } } } // if we generated an error, create an error return response if ($err) { return new xmlrpcresp(0, $xmlrpcerruser, $err); } else { // otherwise, we create the right response // with the state name return new xmlrpcresp(php_xmlrpc_encode($ra)); } } $s = new xmlrpc_server(array( "discuss.addComment" => array( "function" => "addcomment", "signature" => $addcomment_sig, "docstring" => $addcomment_doc, ), "discuss.getComments" => array( "function" => "getcomments", "signature" => $getcomments_sig, "docstring" => $getcomments_doc, ), ));