--- res_config_mysql.c 2007-10-06 16:34:40.000000000 +0000 +++ res_config_mysql.c.orig 2007-10-06 16:32:15.000000000 +0000 @@ -397,7 +397,7 @@ return NULL; } - snprintf(sql, sizeof(sql), "SELECT category, var_name, var_val, cat_metric FROM %s WHERE filename='%s' and commented=0 ORDER BY filename, cat_metric desc, category , var_metric asc, category, var_name, var_val, id", table, file); + snprintf(sql, sizeof(sql), "SELECT category, var_name, var_val, cat_metric FROM %s WHERE filename='%s' and commented=0 ORDER BY filename, cat_metric desc, var_metric asc, category, var_name, var_val, id", table, file); ast_log(LOG_DEBUG, "MySQL RealTime: Static SQL: %s\n", sql);