Hi Anantha,
sorry for the delay. It looks as if the current version of the PHP client API provides no implementation for more() and next() functions, so you should probably call execute() instead. Maybe there are volunteers out there who are interested in complementing the PHP code?
Best, Christian ___________________________
On Fri, Apr 12, 2013 at 10:30 AM, Anantha tejas ananthatejas@gmail.com wrote:
<?php /* * This example shows how results from a query can be received in an iterative * mode and illustrated in a table. * * (C) BaseX Team 2005-12, BSD License */ include("basexclient.php"); // commands to be performed $cmd = '//mondial/country[@id="f0_136"]/name/text()'; $cmd2 = '//mondial/country[@id="f0_136"]/city[@id="f0_1461"]/name/text()=="" or 1=1'; try { // create session $session = new Session("localhost", 1984, "admin", "admin"); echo "<table border='0' cellspacing='2' cellpadding='4' width='20%'><tbody><tr style='text-align:center;'>"; echo "<td style='text-align:center;background-color:#D7D7D7;border:#ffffff 1px solid;font-size:12pt;'></td>"; echo "<td style='text-align:center;background-color:#D7D7D7;border:#ffffff 1px solid;font-size:12pt;'>Country</td>"; echo "<td style='text-align:center;background-color:#D7D7D7;border:#ffffff 1px solid;font-size:12pt;'>Population</td>"; try { $query = $session->query($cmd); $query2 = $session->query($cmd2); $count = 0; --------------->while($query->more()) { $next = $query->next(); $query2->more(); $next2 = $query2->next(); $count += 1; if($count%2) { echo "<tr style='text-align:center;'> <td style='text-align:center;'>$count</td><td style='text-align:center;'>$next</td> <td style='text-align:center;'>$next2</td></tr>"; } else { echo "<tr style='text-align:center; background-color:#eeeeee;'> <td style='text-align:center;'>$count</td><td style='text-align:center;'>$next</td> <td style='text-align:center;'>$next2</td></tr>"; } } $query->close(); $query2->close(); } catch (Exception $e) { // print exception print $e->getMessage(); } echo "</tbody></table>"; $query->close(); // close session $session->close(); } catch (Exception $e) { // print exception print $e->getMessage(); } ?>
I have pasted the whole code I am using. As I have highlighted the $query->more() function is being said to be undefined.
On Fri, Apr 12, 2013 at 1:57 PM, Christian Grün christian.gruen@gmail.com wrote:
Could you provide me with a small PHP example code? ___________________________
On Fri, Apr 12, 2013 at 10:25 AM, Anantha tejas ananthatejas@gmail.com wrote:
In the documentation provided it just says the inner class Query is being used but where do I get it and how do I use it ?
On Fri, Apr 12, 2013 at 1:54 PM, Anantha tejas ananthatejas@gmail.com wrote:
Hi Christian,
Yes. I was using the BaseXClient.php functions provided to query BaseX databases using PHP. There is a class defined called Query but the inner functions provided are not working. These are with respect to the examples provided for using BaseX with PHP.
On Fri, Apr 12, 2013 at 1:51 PM, Christian Grün christian.gruen@gmail.com wrote:
Dear Anantha,
thanks for your mail. I guess we need more precise information to help you. A Google search for your error string seems to indicate you are using the PHP client?
Christian ___________________________
Fatal error: Call to undefined method Query::more()
Where do I get the inner class Query and its functions ?
Regards, Ananthatejas Raghavan Final Year, Computer Engineering NITK Surathkal Contact : 9480114601
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
-- Regards, Ananthatejas Raghavan Final Year, Computer Engineering NITK Surathkal Contact : 9480114601
-- Regards, Ananthatejas Raghavan Final Year, Computer Engineering NITK Surathkal Contact : 9480114601
-- Regards, Ananthatejas Raghavan Final Year, Computer Engineering NITK Surathkal Contact : 9480114601