]> git.webhop.me Git - lcd4linux.git/commitdiff
[lcd4linux @ 2006-01-20 15:58:05 by reinelt]
authorreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Fri, 20 Jan 2006 15:58:05 +0000 (15:58 +0000)
committerreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Fri, 20 Jan 2006 15:58:05 +0000 (15:58 +0000)
MySQL::count() added again

git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@616 3ae390bd-cb1e-0410-b409-cd5a39f66f1f

lcd4linux.conf.sample
plugin_mysql.c

index 06c423e03dcf81b5a9363d3be8ec9f352f141f39..7df00534eb6f1151121451ee56368ce0c3cbf578 100644 (file)
@@ -929,7 +929,7 @@ Layout testMySQL {
 #Display 'LCM-162'
 #Display 'CF631'
 #Display 'CF632'
-Display 'CF633'
+#Display 'CF633'
 #Display 'Curses'
 #Display 'M50530-24x8'
 #Display 'LCDTerm'
@@ -937,7 +937,7 @@ Display 'CF633'
 #Display 'BA63'
 #Display 'CT20x4'
 #Display 'T6963-240x64'
-#Display 'XWindow'
+Display 'XWindow'
 #Display 'USBLCD'
 #Display 'BWCT'
 #Display 'Image'
@@ -945,12 +945,12 @@ Display 'CF633'
 #Display 'LPH7508-serdisplib'
 #Display 'LPH7508'
 
-#Layout 'Default'
+Layout 'Default'
 #Layout 'L8x2'
 #Layout 'L16x2'
 #Layout 'L20x2'
 #Layout 'Test'
 #Layout 'Test2'
-Layout 'TestGPO'
+#Layout 'TestGPO'
 
 
index fd35e11f9c5ee727df7f30cfa4e50df20fd329ba..1ccdb0ed2af538e6abd548ab23ec83010b695284 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: plugin_mysql.c,v 1.9 2006/01/20 15:43:25 reinelt Exp $
+/* $Id: plugin_mysql.c,v 1.10 2006/01/20 15:58:05 reinelt Exp $
  *
  * plugin for execute SQL queries into a MySQL DBSM.
  *
@@ -23,6 +23,9 @@
  *
  *
  * $Log: plugin_mysql.c,v $
+ * Revision 1.10  2006/01/20 15:58:05  reinelt
+ * MySQL::count() added again
+ *
  * Revision 1.9  2006/01/20 15:43:25  reinelt
  * MySQL::query() returns a value, not the number of rows
  *
@@ -162,9 +165,7 @@ 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)
+static void my_MySQLcount(RESULT * result, RESULT * query)
 {
     char *q;
     double value;
@@ -195,7 +196,6 @@ static void my_MySQLquery(RESULT * result, RESULT * query)
 
     SetResult(&result, R_NUMBER, &value);
 }
-#endif
 
 
 static void my_MySQLquery(RESULT * result, RESULT * query)
@@ -259,6 +259,7 @@ static void my_MySQLstatus(RESULT * result)
 int plugin_init_mysql(void)
 {
 #ifdef HAVE_MYSQL_MYSQL_H
+    AddFunction("MySQL::count", 1, my_MySQLcount);
     AddFunction("MySQL::query", 1, my_MySQLquery);
     AddFunction("MySQL::status", 0, my_MySQLstatus);
 #endif