aboutsummaryrefslogtreecommitdiffstats
path: root/plugin_mysql.c
diff options
context:
space:
mode:
authorreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2006-01-20 15:43:25 +0000
committerreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2006-01-20 15:43:25 +0000
commit544d467bfb7de1663692e230a8757e64270b335c (patch)
treec2089009635951c46affcc9ae3cfa3443d1c74a0 /plugin_mysql.c
parent810214748fa605c93882b927bc951a49e4bc82c1 (diff)
downloadlcd4linux-544d467bfb7de1663692e230a8757e64270b335c.tar.gz
[lcd4linux @ 2006-01-20 15:43:25 by reinelt]
MySQL::query() returns a value, not the number of rows git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@615 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
Diffstat (limited to 'plugin_mysql.c')
-rw-r--r--plugin_mysql.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/plugin_mysql.c b/plugin_mysql.c
index 49af25c..fd35e11 100644
--- a/plugin_mysql.c
+++ b/plugin_mysql.c
@@ -1,4 +1,4 @@
-/* $Id: plugin_mysql.c,v 1.8 2006/01/16 15:39:58 reinelt Exp $
+/* $Id: plugin_mysql.c,v 1.9 2006/01/20 15:43:25 reinelt Exp $
*
* plugin for execute SQL queries into a MySQL DBSM.
*
@@ -23,6 +23,9 @@
*
*
* $Log: plugin_mysql.c,v $
+ * Revision 1.9 2006/01/20 15:43:25 reinelt
+ * MySQL::query() returns a value, not the number of rows
+ *
* Revision 1.8 2006/01/16 15:39:58 reinelt
* MySQL::queryvalue() extension from Harald Klemm
*
@@ -159,13 +162,14 @@ static int configure_mysql(void)
return configured;
}
-
+#if 0
+/* removed because you can use 'query("select count(*)")' */
static void my_MySQLquery(RESULT * result, RESULT * query)
{
char *q;
double value;
MYSQL_RES *res;
-
+
if (configure_mysql() < 0) {
value = -1;
SetResult(&result, R_NUMBER, &value);
@@ -191,8 +195,10 @@ static void my_MySQLquery(RESULT * result, RESULT * query)
SetResult(&result, R_NUMBER, &value);
}
+#endif
+
-static void my_MySQLqueryValue(RESULT * result, RESULT * query)
+static void my_MySQLquery(RESULT * result, RESULT * query)
{
char *q;
double value;
@@ -254,7 +260,6 @@ int plugin_init_mysql(void)
{
#ifdef HAVE_MYSQL_MYSQL_H
AddFunction("MySQL::query", 1, my_MySQLquery);
- AddFunction("MySQL::queryvalue", 1, my_MySQLqueryValue);
AddFunction("MySQL::status", 0, my_MySQLstatus);
#endif
return 0;