Re: [MonetDB-users] Using MonetDB / XQuery with PHP
Unfortunately I don't have too much time this and next week, so the fix will have to wait a bit. I'll try and see in the weekend if I can easily fix it.
Ok, in the mean time my work around is as follows: 1 - make a temporary .xq file somwhere on your file-system using PHP 2 - invoke this file using: $output = shell_exec('MapiClient.bat -l xquery tempXQFile.xq'); header("Content-Type: text/xml"); echo $output; But offcourse a proper database-connection is preferred. Looking forward to some kind of solution! With kind regards, Menno Holtkamp -----Original Message----- From: Fabian Groffen [mailto:Fabian.Groffen@cwi.nl] Sent: Thu 11/23/2006 2:35 PM To: monetdb-users@lists.sourceforge.net Cc: Subject: Re: [MonetDB-users] Using MonetDB / XQuery with PHP On 23-11-2006 14:21:44 +0100, Menno Holtkamp wrote: [snip]
Performing a query with:
$query = 'count(doc("HelloWorld.xml")/doc)'; $result = monetdb_query($query); if(!$result)die("Query failed : " . monetdb_error() ."\n"); else echo '<br>Performed query';
succeeds as well.
But the content of the result set seems to remain 'empty'.
print_r($result) -> Resource id #3
But while($row = monetdb_fetch_array($result)) { print_r($row); }
remains empty.
I see. This is probably because the default XQuery output is a wee bit different. ;) I might be able to fix monetdb_php to support XQuery like JDBC does. Unfortunately I don't have too much time this and next week, so the fix will have to wait a bit. I'll try and see in the weekend if I can easily fix it.
Does somebody have a working example of performing an XQuery using PHP?
No ;)
I wondered, is it required to connect to a specific database in the monetdb_connect command? (the XML-document) I think not, but hey!
Nope; this only works on M5 which has support for multiple catalogs. ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users
On 23-11-2006 15:33:51 +0100, Menno Holtkamp wrote:
Unfortunately I don't have too much time this and next week, so the fix will have to wait a bit. I'll try and see in the weekend if I can easily fix it.
Ok, in the mean time my work around is as follows:
I just checked in a "wanna-be" fix consisting of 4 lines which should make it possible/easier to use xquery from within PHP. I could not test this fix, because I currently lack the infrastructure to test :( So, I guess the problem is now how to get my fix running with you, so we can see if it works. Do you happen to have MonetDB compiled from source?
So, I guess the problem is now how to get my fix running with you, so we can see if it works. Do you happen to have MonetDB compiled from source?
No, I'm using the binary distribution, maybe next year I have some more time to set up the compile enviroment. I tried following http://monetdb.cwi.nl/XQuery/Documentation/Installation/Source/MinGW/index.h... these steps for compiling in a windows environment. I kind of get stuck at compiling the libxml2 part already. For this time seems quite complicated to me, when is the next binary release planned, or can somebody provide me with a windows-binary of the current version (pathfinder 0.14?) Cheers! -- View this message in context: http://www.nabble.com/Using-MonetDB----XQuery-with-PHP-tf2684807.html#a78527... Sent from the monetdb-users mailing list archive at Nabble.com.
participants (3)
-
Fabian Groffen
-
holtkamp
-
Menno Holtkamp