From birnbacs at gmail.com Mon Jul 16 07:59:54 2018 From: birnbacs at gmail.com (Sebastian Birnbach) Date: Mon, 16 Jul 2018 09:59:54 +0200 Subject: [dev] Horde_Db_Adapter count matching records Message-ID: All, I am using Horde_Db_Adapter for querying a mySQL database; driver is mysqli. I need to get the number of results for a query in order to display them pagewise. $adapter = $injector->getInstance('Horde_Db_Adapter'); $query = "SELECT (*) FROM my_table WHERE variable = condition"; $res = $adapter->select($query); $numres = iterator_count($res); If results are plenty, retrieving all of them may put a huge load on the webserver, so I tried database counting: $query = "SELECT COUNT (my_table.variable) AS myvar FROM my_table WHERE variable = condition"; but wthout luck: QUERY FAILED: FUNCTION horde.COUNT does not exist. Question: is there a way of determining, with the Horde DB adapter, how many records match a given query without actually retrieving the records? Thanks birnbacs From birnbacs at gmail.com Mon Jul 16 09:16:09 2018 From: birnbacs at gmail.com (Sebastian Birnbach) Date: Mon, 16 Jul 2018 11:16:09 +0200 Subject: [dev] Horde_Db_Adapter count matching records In-Reply-To: References: Message-ID: SOLVED, please disregard previous mail. For the archives: COUNT() is a SQL function; for calling there must not be a space before the brackets: COUNT(*) <-- OK COUNT (*) <-- NOK birnbacs 2018-07-16 9:59 GMT+02:00 Sebastian Birnbach : > All, > > I am using Horde_Db_Adapter for querying a mySQL database; driver is > mysqli. I need to get the number of results for a query in order to display > them pagewise. > > $adapter = $injector->getInstance('Horde_Db_Adapter'); > $query = "SELECT (*) FROM my_table WHERE variable = condition"; > $res = $adapter->select($query); > $numres = iterator_count($res); > > > If results are plenty, retrieving all of them may put a huge load on the > webserver, so I tried database counting: > > $query = "SELECT COUNT (my_table.variable) AS myvar FROM my_table WHERE > variable = condition"; > > but wthout luck: > > QUERY FAILED: FUNCTION horde.COUNT does not exist. > > > Question: is there a way of determining, with the Horde DB adapter, how > many records match a given query without actually retrieving the records? > > > Thanks > > birnbacs > From hordelist at lemmen.com Wed Jul 18 11:47:32 2018 From: hordelist at lemmen.com (sky) Date: Wed, 18 Jul 2018 07:47:32 -0400 (EDT) Subject: [dev] Add button on long press mobile version Message-ID: I would like to add a button to move a message to a mbox file when you tap and hold on a message. Currently a Delete option comes up when doing a long press. I have added a button labeled MyBox as follows: horde/imp/templates/smartmobile/mailbox.html.php
What do I need to put in for the href to have the messages moved to the mailbox MyBox? I found the copymove in /usr/local/horde/imp/js/smartmobile.js which is where mailbox-delete seems to be located. When I press on the MyBox option that comes up on a long hold, it deletes the message and puts in in Trash, which I don't want. I want to instead hardcode in a mailbox to move the message, how can this be done?