Index: trunk/psLib/src/db/psDB.c
===================================================================
--- trunk/psLib/src/db/psDB.c	(revision 4589)
+++ trunk/psLib/src/db/psDB.c	(revision 4612)
@@ -12,6 +12,6 @@
  *  @author Joshua Hoblitt
  *
- *  @version $Revision: 1.40 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-07-21 01:40:10 $
+ *  @version $Revision: 1.41 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-07-26 20:00:57 $
  *
  *  Copyright 2005 Joshua Hoblitt, University of Hawaii
@@ -853,6 +853,10 @@
 
 bool p_psDBRunQuery(psDB *dbh,
-                    const char *format)
-{
+                    const char *format,
+                    ...)
+{
+    va_list argPtr;
+    char *dest = NULL;
+
     // Verify database object is not NULL
     if(dbh == NULL) {
@@ -862,9 +866,20 @@
 
     // Run query
-    if (mysql_real_query(dbh->mysql, format, (unsigned long)strlen(format)) !=0) {
+    va_start(argPtr, format);
+    if(argPtr == NULL) {
+        dest=psStringCopy(format);
+    } else {
+        int destSize = vsnprintf(dest, 0, format, argPtr);
+        dest = psAlloc(destSize+1);
+        vsnprintf(dest, destSize+1, format, argPtr);
+    }
+    va_end(argPtr);
+    if (mysql_real_query(dbh->mysql, dest, (unsigned long)strlen(dest)) !=0) {
         psError(PS_ERR_UNKNOWN, true, PS_ERRORTEXT_psDB_SQL_QUERY_FAIL, mysql_error(dbh->mysql));
+        psFree(dest);
         return false;
     }
 
+    psFree(dest);
     return true;
 }
Index: trunk/psLib/src/db/psDB.h
===================================================================
--- trunk/psLib/src/db/psDB.h	(revision 4589)
+++ trunk/psLib/src/db/psDB.h	(revision 4612)
@@ -10,6 +10,6 @@
  *  @author Joshua Hoblitt
  *
- *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-07-21 01:40:10 $
+ *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-07-26 20:00:57 $
  *
  *  Copyright 2005 Joshua Hoblitt, University of Hawaii
@@ -92,5 +92,6 @@
 bool p_psDBRunQuery(
     psDB *dbh,                         ///< Database handle
-    const char *format                 ///< SQL string to execute
+    const char *format,                ///< SQL string to execute
+    ...                                ///< Arguments for name formatting and metadata item data.
 );
 
