Exemplo n.º 1
0
void CfNewQueryDB(CfdbConn *cfdb, char *query)
{
    cfdb->result = false;
    cfdb->row = 0;
    cfdb->column = 0;
    cfdb->rowdata = NULL;
    cfdb->maxcolumns = 0;
    cfdb->maxrows = 0;

    CfDebug("Before Query succeeded: %s - %d,%d\n", query, cfdb->maxrows, cfdb->maxcolumns);

    switch (cfdb->type)
    {
    case cfd_mysql:
        CfNewQueryMysqlDb(cfdb, query);
        break;

    case cfd_postgres:
        CfNewQueryPostgresqlDb(cfdb, query);
        break;

    default:
        CfOut(cf_verbose, "", "There is no SQL database selected");
        break;
    }

    CfDebug("Query succeeded: (%s) %d,%d\n", query, cfdb->maxrows, cfdb->maxcolumns);
}
Exemplo n.º 2
0
Arquivo: cf_sql.c Projeto: JarleB/core
void CfNewQueryDB(CfdbConn *cfdb, char *query)
{
    cfdb->result = false;
    cfdb->row = 0;
    cfdb->column = 0;
    cfdb->rowdata = NULL;
    cfdb->maxcolumns = 0;
    cfdb->maxrows = 0;

    Log(LOG_LEVEL_DEBUG, "Before query '%s' succeeded, maxrows %d, maxcolumns %d", query, cfdb->maxrows, cfdb->maxcolumns);

    switch (cfdb->type)
    {
    case DATABASE_TYPE_MYSQL:
        CfNewQueryMysqlDb(cfdb, query);
        break;

    case DATABASE_TYPE_POSTGRES:
        CfNewQueryPostgresqlDb(cfdb, query);
        break;

    default:
        Log(LOG_LEVEL_VERBOSE, "There is no SQL database selected");
        break;
    }

    Log(LOG_LEVEL_DEBUG, "Query '%s' succeeded. maxrows %d, maxcolumns %d", query, cfdb->maxrows, cfdb->maxcolumns);
}