[Monetdb-developers] Re: FW: Returned mail: see transcript for details

Fabian (MonetDB Project) monet at cwi.nl
Thu Jun 16 10:58:54 CEST 2005


Ignacio Hernandez-Ros wrote:
> Hello,
> 
> I've successfully moved the source to work with PHP5. The only change that I
> made was to replace occurrences of OnUpdateInt to OnUpdateLong (two
> occurrences)

Can you supply a patch easily?  Would be great to have it.

> 
> Now I'm in the next problem:
> 
> I wish to execute an xquery and receive the XML output back in the php.
> This is the example that I'm doing:
> 
> <?php
> if (!extension_loaded('monetdb')) {
>   $loadedOk = dl('monetdb.so');
>   if (!loadedOk) {
>     die('Module not loaded');
>   }
> }
> $link = monetdb_connect('mil');
> if (!$link) {
>     die('Could not connect: ' . monetdb_error());
> }
> $res = monetdb_query('xquery("xml","<hello>hola</hello>");');
> echo $res;
> 
> while($row = monetdb_fetch_row($res)) {
>         printf("name=%s htype=%s ttype=%s \n",$row[0],$row[1],$row[2]);
> }

I'm not sure here, but you can try:

         $cols = monetdb_num_fields($result);
         while ($row = @monetdb_fetch_row($res)) {
             for ($i = 0; $i < $cols; $i++) {
                 print htmlspecialchars($row[$i]);
             }
             print "<br />";
         }

have you tried the query you're executing using MapiClient to see if it 
results in what you expect?  You might need to connect using xquery 
otherwise, but I'm not sure on that.

Regards,
Fabian

> monetdb_close();
> ?>
> 
> The query is executed but I don't find a way to obtain the xml back to the
> php.
> 
> What shall I do?
> 
> Ignacio Hernandez-Ros
> XBRL International Inc. - Technology Development
> ihr at xbrl.org
> Cell: +34 609027754
> 




More information about the developers-list mailing list