From 544d467bfb7de1663692e230a8757e64270b335c Mon Sep 17 00:00:00 2001 From: reinelt Date: Fri, 20 Jan 2006 15:43:25 +0000 Subject: [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 --- plugin_mysql.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'plugin_mysql.c') 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; -- cgit v1.2.3