mirror of https://github.com/acanas/swad-core.git
Version 20.55: Apr 04, 2021 Optimizations in database selects.
This commit is contained in:
parent
fb564b58cf
commit
9dba8e5314
798
swad_API.c
798
swad_API.c
File diff suppressed because it is too large
Load Diff
|
@ -684,7 +684,6 @@ static void Asg_GetListAssignments (struct Asg_Assignments *Assignments)
|
||||||
[Dat_END_TIME ] = "EndTime DESC,StartTime DESC,Title DESC",
|
[Dat_END_TIME ] = "EndTime DESC,StartTime DESC,Title DESC",
|
||||||
};
|
};
|
||||||
MYSQL_RES *mysql_res;
|
MYSQL_RES *mysql_res;
|
||||||
MYSQL_ROW row;
|
|
||||||
unsigned long NumRows;
|
unsigned long NumRows;
|
||||||
unsigned NumAsg;
|
unsigned NumAsg;
|
||||||
|
|
||||||
|
@ -741,8 +740,7 @@ static void Asg_GetListAssignments (struct Asg_Assignments *Assignments)
|
||||||
NumAsg++)
|
NumAsg++)
|
||||||
{
|
{
|
||||||
/* Get next assignment code */
|
/* Get next assignment code */
|
||||||
row = mysql_fetch_row (mysql_res);
|
if ((Assignments->LstAsgCods[NumAsg] = DB_GetNextCod (mysql_res)) < 0)
|
||||||
if ((Assignments->LstAsgCods[NumAsg] = Str_ConvertStrCodToLongCod (row[0])) < 0)
|
|
||||||
Lay_ShowErrorAndExit ("Error: wrong assignment code.");
|
Lay_ShowErrorAndExit ("Error: wrong assignment code.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -668,7 +668,6 @@ static void Att_GetListAttEvents (struct Att_Events *Events,
|
||||||
[Dat_END_TIME ][Att_OLDEST_FIRST] = "EndTime,StartTime,Title",
|
[Dat_END_TIME ][Att_OLDEST_FIRST] = "EndTime,StartTime,Title",
|
||||||
};
|
};
|
||||||
MYSQL_RES *mysql_res;
|
MYSQL_RES *mysql_res;
|
||||||
MYSQL_ROW row;
|
|
||||||
unsigned long NumRows;
|
unsigned long NumRows;
|
||||||
unsigned NumAttEvent;
|
unsigned NumAttEvent;
|
||||||
|
|
||||||
|
@ -721,8 +720,7 @@ static void Att_GetListAttEvents (struct Att_Events *Events,
|
||||||
NumAttEvent++)
|
NumAttEvent++)
|
||||||
{
|
{
|
||||||
/* Get next attendance event code */
|
/* Get next attendance event code */
|
||||||
row = mysql_fetch_row (mysql_res);
|
if ((Events->Lst[NumAttEvent].AttCod = DB_GetNextCod (mysql_res)) < 0)
|
||||||
if ((Events->Lst[NumAttEvent].AttCod = Str_ConvertStrCodToLongCod (row[0])) < 0)
|
|
||||||
Lay_ShowErrorAndExit ("Error: wrong attendance event code.");
|
Lay_ShowErrorAndExit ("Error: wrong attendance event code.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -873,7 +871,7 @@ static void Att_GetAttEventDescriptionFromDB (long AttCod,char Description[Cns_M
|
||||||
|
|
||||||
/***** Get text of attendance event from database *****/
|
/***** Get text of attendance event from database *****/
|
||||||
NumRows = DB_QuerySELECT (&mysql_res,"can not get attendance event text",
|
NumRows = DB_QuerySELECT (&mysql_res,"can not get attendance event text",
|
||||||
"SELECT Txt"
|
"SELECT Txt" // row[0]
|
||||||
" FROM att_events"
|
" FROM att_events"
|
||||||
" WHERE AttCod=%ld"
|
" WHERE AttCod=%ld"
|
||||||
" AND CrsCod=%ld",
|
" AND CrsCod=%ld",
|
||||||
|
@ -1549,21 +1547,22 @@ static void Att_GetAndWriteNamesOfGrpsAssociatedToAttEvent (struct Att_Event *Ev
|
||||||
unsigned NumGrps;
|
unsigned NumGrps;
|
||||||
|
|
||||||
/***** Get groups associated to an attendance event from database *****/
|
/***** Get groups associated to an attendance event from database *****/
|
||||||
NumGrps = (unsigned) DB_QuerySELECT (&mysql_res,"can not get groups of an attendance event",
|
NumGrps = (unsigned)
|
||||||
"SELECT grp_types.GrpTypName," // row[0]
|
DB_QuerySELECT (&mysql_res,"can not get groups of an attendance event",
|
||||||
"grp_groups.GrpName," // row[1]
|
"SELECT grp_types.GrpTypName," // row[0]
|
||||||
"roo_rooms.ShortName" // row[2]
|
"grp_groups.GrpName," // row[1]
|
||||||
" FROM (att_groups,"
|
"roo_rooms.ShortName" // row[2]
|
||||||
"grp_groups,"
|
" FROM (att_groups,"
|
||||||
"grp_types)"
|
"grp_groups,"
|
||||||
" LEFT JOIN roo_rooms"
|
"grp_types)"
|
||||||
" ON grp_groups.RooCod=roo_rooms.RooCod"
|
" LEFT JOIN roo_rooms"
|
||||||
" WHERE att_groups.AttCod=%ld"
|
" ON grp_groups.RooCod=roo_rooms.RooCod"
|
||||||
" AND att_groups.GrpCod=grp_groups.GrpCod"
|
" WHERE att_groups.AttCod=%ld"
|
||||||
" AND grp_groups.GrpTypCod=grp_types.GrpTypCod"
|
" AND att_groups.GrpCod=grp_groups.GrpCod"
|
||||||
" ORDER BY grp_types.GrpTypName,"
|
" AND grp_groups.GrpTypCod=grp_types.GrpTypCod"
|
||||||
"grp_groups.GrpName",
|
" ORDER BY grp_types.GrpTypName,"
|
||||||
Event->AttCod);
|
"grp_groups.GrpName",
|
||||||
|
Event->AttCod);
|
||||||
|
|
||||||
/***** Write heading *****/
|
/***** Write heading *****/
|
||||||
HTM_DIV_Begin ("class=\"%s\"",Event->Hidden ? "ASG_GRP_LIGHT" :
|
HTM_DIV_Begin ("class=\"%s\"",Event->Hidden ? "ASG_GRP_LIGHT" :
|
||||||
|
@ -1720,73 +1719,54 @@ unsigned Att_GetNumAttEventsInCrs (long CrsCod)
|
||||||
|
|
||||||
unsigned Att_GetNumCoursesWithAttEvents (Hie_Lvl_Level_t Scope)
|
unsigned Att_GetNumCoursesWithAttEvents (Hie_Lvl_Level_t Scope)
|
||||||
{
|
{
|
||||||
MYSQL_RES *mysql_res;
|
|
||||||
MYSQL_ROW row;
|
|
||||||
unsigned NumCourses;
|
|
||||||
|
|
||||||
/***** Get number of courses with attendance events from database *****/
|
/***** Get number of courses with attendance events from database *****/
|
||||||
switch (Scope)
|
switch (Scope)
|
||||||
{
|
{
|
||||||
case Hie_Lvl_SYS:
|
case Hie_Lvl_SYS:
|
||||||
DB_QuerySELECT (&mysql_res,"can not get number of courses with attendance events",
|
return DB_QueryCOUNT ("can not get number of courses with attendance events",
|
||||||
"SELECT COUNT(DISTINCT CrsCod)"
|
"SELECT COUNT(DISTINCT CrsCod)"
|
||||||
" FROM att_events"
|
" FROM att_events"
|
||||||
" WHERE CrsCod>0");
|
" WHERE CrsCod>0");
|
||||||
break;
|
|
||||||
case Hie_Lvl_INS:
|
case Hie_Lvl_INS:
|
||||||
DB_QuerySELECT (&mysql_res,"can not get number of courses with attendance events",
|
return DB_QueryCOUNT ("can not get number of courses with attendance events",
|
||||||
"SELECT COUNT(DISTINCT att_events.CrsCod)"
|
"SELECT COUNT(DISTINCT att_events.CrsCod)"
|
||||||
" FROM ctr_centers,"
|
" FROM ctr_centers,"
|
||||||
"deg_degrees,"
|
"deg_degrees,"
|
||||||
"crs_courses,"
|
"crs_courses,"
|
||||||
"att_events"
|
"att_events"
|
||||||
" WHERE ctr_centers.InsCod=%ld"
|
" WHERE ctr_centers.InsCod=%ld"
|
||||||
" AND ctr_centers.CtrCod=deg_degrees.CtrCod"
|
" AND ctr_centers.CtrCod=deg_degrees.CtrCod"
|
||||||
" AND deg_degrees.DegCod=crs_courses.DegCod"
|
" AND deg_degrees.DegCod=crs_courses.DegCod"
|
||||||
" AND crs_courses.CrsCod=att_events.CrsCod",
|
" AND crs_courses.CrsCod=att_events.CrsCod",
|
||||||
Gbl.Hierarchy.Ins.InsCod);
|
Gbl.Hierarchy.Ins.InsCod);
|
||||||
break;
|
|
||||||
case Hie_Lvl_CTR:
|
case Hie_Lvl_CTR:
|
||||||
DB_QuerySELECT (&mysql_res,"can not get number of courses with attendance events",
|
return DB_QueryCOUNT ("can not get number of courses with attendance events",
|
||||||
"SELECT COUNT(DISTINCT att_events.CrsCod)"
|
"SELECT COUNT(DISTINCT att_events.CrsCod)"
|
||||||
" FROM deg_degrees,"
|
" FROM deg_degrees,"
|
||||||
"crs_courses,"
|
"crs_courses,"
|
||||||
"att_events"
|
"att_events"
|
||||||
" WHERE deg_degrees.CtrCod=%ld"
|
" WHERE deg_degrees.CtrCod=%ld"
|
||||||
" AND deg_degrees.DegCod=crs_courses.DegCod"
|
" AND deg_degrees.DegCod=crs_courses.DegCod"
|
||||||
" AND crs_courses.CrsCod=att_events.CrsCod",
|
" AND crs_courses.CrsCod=att_events.CrsCod",
|
||||||
Gbl.Hierarchy.Ctr.CtrCod);
|
Gbl.Hierarchy.Ctr.CtrCod);
|
||||||
break;
|
|
||||||
case Hie_Lvl_DEG:
|
case Hie_Lvl_DEG:
|
||||||
DB_QuerySELECT (&mysql_res,"can not get number of courses with attendance events",
|
return DB_QueryCOUNT ("can not get number of courses with attendance events",
|
||||||
"SELECT COUNT(DISTINCT att_events.CrsCod)"
|
"SELECT COUNT(DISTINCT att_events.CrsCod)"
|
||||||
" FROM crs_courses,"
|
" FROM crs_courses,"
|
||||||
"att_events"
|
"att_events"
|
||||||
" WHERE crs_courses.DegCod=%ld"
|
" WHERE crs_courses.DegCod=%ld"
|
||||||
" AND crs_courses.CrsCod=att_events.CrsCod",
|
" AND crs_courses.CrsCod=att_events.CrsCod",
|
||||||
Gbl.Hierarchy.Deg.DegCod);
|
Gbl.Hierarchy.Deg.DegCod);
|
||||||
break;
|
|
||||||
case Hie_Lvl_CRS:
|
case Hie_Lvl_CRS:
|
||||||
DB_QuerySELECT (&mysql_res,"can not get number of courses with attendance events",
|
return DB_QueryCOUNT ("can not get number of courses with attendance events",
|
||||||
"SELECT COUNT(DISTINCT CrsCod)"
|
"SELECT COUNT(DISTINCT CrsCod)"
|
||||||
" FROM att_events"
|
" FROM att_events"
|
||||||
" WHERE CrsCod=%ld",
|
" WHERE CrsCod=%ld",
|
||||||
Gbl.Hierarchy.Crs.CrsCod);
|
Gbl.Hierarchy.Crs.CrsCod);
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
Lay_WrongScopeExit ();
|
Lay_WrongScopeExit ();
|
||||||
break;
|
return 0; // Not reached
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Get number of courses *****/
|
|
||||||
row = mysql_fetch_row (mysql_res);
|
|
||||||
if (sscanf (row[0],"%u",&NumCourses) != 1)
|
|
||||||
Lay_ShowErrorAndExit ("Error when getting number of courses with attendance events.");
|
|
||||||
|
|
||||||
/***** Free structure that stores the query result *****/
|
|
||||||
DB_FreeMySQLResult (&mysql_res);
|
|
||||||
|
|
||||||
return NumCourses;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -1806,15 +1786,15 @@ unsigned Att_GetNumAttEvents (Hie_Lvl_Level_t Scope,unsigned *NumNotif)
|
||||||
{
|
{
|
||||||
case Hie_Lvl_SYS:
|
case Hie_Lvl_SYS:
|
||||||
DB_QuerySELECT (&mysql_res,"can not get number of attendance events",
|
DB_QuerySELECT (&mysql_res,"can not get number of attendance events",
|
||||||
"SELECT COUNT(*),"
|
"SELECT COUNT(*)," // row[0]
|
||||||
"SUM(NumNotif)"
|
"SUM(NumNotif)" // row[1]
|
||||||
" FROM att_events"
|
" FROM att_events"
|
||||||
" WHERE CrsCod>0");
|
" WHERE CrsCod>0");
|
||||||
break;
|
break;
|
||||||
case Hie_Lvl_INS:
|
case Hie_Lvl_INS:
|
||||||
DB_QuerySELECT (&mysql_res,"can not get number of attendance events",
|
DB_QuerySELECT (&mysql_res,"can not get number of attendance events",
|
||||||
"SELECT COUNT(*),"
|
"SELECT COUNT(*)," // row[0]
|
||||||
"SUM(att_events.NumNotif)"
|
"SUM(att_events.NumNotif)" // row[1]
|
||||||
" FROM ctr_centers,"
|
" FROM ctr_centers,"
|
||||||
"deg_degrees,"
|
"deg_degrees,"
|
||||||
"crs_courses,"
|
"crs_courses,"
|
||||||
|
@ -1827,8 +1807,8 @@ unsigned Att_GetNumAttEvents (Hie_Lvl_Level_t Scope,unsigned *NumNotif)
|
||||||
break;
|
break;
|
||||||
case Hie_Lvl_CTR:
|
case Hie_Lvl_CTR:
|
||||||
DB_QuerySELECT (&mysql_res,"can not get number of attendance events",
|
DB_QuerySELECT (&mysql_res,"can not get number of attendance events",
|
||||||
"SELECT COUNT(*),"
|
"SELECT COUNT(*)," // row[0]
|
||||||
"SUM(att_events.NumNotif)"
|
"SUM(att_events.NumNotif)" // row[1]
|
||||||
" FROM deg_degrees,"
|
" FROM deg_degrees,"
|
||||||
"crs_courses,"
|
"crs_courses,"
|
||||||
"att_events"
|
"att_events"
|
||||||
|
@ -1839,8 +1819,8 @@ unsigned Att_GetNumAttEvents (Hie_Lvl_Level_t Scope,unsigned *NumNotif)
|
||||||
break;
|
break;
|
||||||
case Hie_Lvl_DEG:
|
case Hie_Lvl_DEG:
|
||||||
DB_QuerySELECT (&mysql_res,"can not get number of attendance events",
|
DB_QuerySELECT (&mysql_res,"can not get number of attendance events",
|
||||||
"SELECT COUNT(*),"
|
"SELECT COUNT(*)," // row[0]
|
||||||
"SUM(att_events.NumNotif)"
|
"SUM(att_events.NumNotif)" // row[1]
|
||||||
" FROM crs_courses,"
|
" FROM crs_courses,"
|
||||||
"att_events"
|
"att_events"
|
||||||
" WHERE crs_courses.DegCod=%ld"
|
" WHERE crs_courses.DegCod=%ld"
|
||||||
|
@ -1849,8 +1829,8 @@ unsigned Att_GetNumAttEvents (Hie_Lvl_Level_t Scope,unsigned *NumNotif)
|
||||||
break;
|
break;
|
||||||
case Hie_Lvl_CRS:
|
case Hie_Lvl_CRS:
|
||||||
DB_QuerySELECT (&mysql_res,"can not get number of attendance events",
|
DB_QuerySELECT (&mysql_res,"can not get number of attendance events",
|
||||||
"SELECT COUNT(*),"
|
"SELECT COUNT(*)," // row[0]
|
||||||
"SUM(NumNotif)"
|
"SUM(NumNotif)" // row[1]
|
||||||
" FROM att_events"
|
" FROM att_events"
|
||||||
" WHERE CrsCod=%ld",
|
" WHERE CrsCod=%ld",
|
||||||
Gbl.Hierarchy.Crs.CrsCod);
|
Gbl.Hierarchy.Crs.CrsCod);
|
||||||
|
@ -2572,7 +2552,7 @@ static bool Att_CheckIfUsrIsInTableAttUsr (long AttCod,long UsrCod,bool *Present
|
||||||
/***** Check if a student is registered in an event in database *****/
|
/***** Check if a student is registered in an event in database *****/
|
||||||
InDBTable = (DB_QuerySELECT (&mysql_res,"can not check if a student"
|
InDBTable = (DB_QuerySELECT (&mysql_res,"can not check if a student"
|
||||||
" is already registered in an event",
|
" is already registered in an event",
|
||||||
"SELECT Present"
|
"SELECT Present" // row[0]
|
||||||
" FROM att_users"
|
" FROM att_users"
|
||||||
" WHERE AttCod=%ld"
|
" WHERE AttCod=%ld"
|
||||||
" AND UsrCod=%ld",
|
" AND UsrCod=%ld",
|
||||||
|
@ -3009,7 +2989,6 @@ static void Att_GetListSelectedAttCods (struct Att_Events *Events)
|
||||||
long AttCod;
|
long AttCod;
|
||||||
char LongStr[Cns_MAX_DECIMAL_DIGITS_LONG + 1];
|
char LongStr[Cns_MAX_DECIMAL_DIGITS_LONG + 1];
|
||||||
MYSQL_RES *mysql_res;
|
MYSQL_RES *mysql_res;
|
||||||
MYSQL_ROW row;
|
|
||||||
unsigned NumGrpsInThisEvent;
|
unsigned NumGrpsInThisEvent;
|
||||||
unsigned NumGrpInThisEvent;
|
unsigned NumGrpInThisEvent;
|
||||||
long GrpCodInThisEvent;
|
long GrpCodInThisEvent;
|
||||||
|
@ -3090,8 +3069,7 @@ static void Att_GetListSelectedAttCods (struct Att_Events *Events)
|
||||||
NumGrpInThisEvent++)
|
NumGrpInThisEvent++)
|
||||||
{
|
{
|
||||||
/* Get next group associated to this event */
|
/* Get next group associated to this event */
|
||||||
row = mysql_fetch_row (mysql_res);
|
if ((GrpCodInThisEvent = DB_GetNextCod (mysql_res)) > 0)
|
||||||
if ((GrpCodInThisEvent = Str_ConvertStrCodToLongCod (row[0])) > 0)
|
|
||||||
/* Check if this group is selected */
|
/* Check if this group is selected */
|
||||||
for (NumGrpSel = 0;
|
for (NumGrpSel = 0;
|
||||||
NumGrpSel < Gbl.Crs.Grps.LstGrpsSel.NumGrps &&
|
NumGrpSel < Gbl.Crs.Grps.LstGrpsSel.NumGrps &&
|
||||||
|
|
|
@ -600,13 +600,14 @@ TODO: Salvador Romero Cort
|
||||||
|
|
||||||
TODO: FIX BUG, URGENT! En las fechas como parámetro Dat_WriteParamsIniEndDates(), por ejemplo al cambiar el color de la gráfica de accesos por día y hora, no se respeta la zona horaria.
|
TODO: FIX BUG, URGENT! En las fechas como parámetro Dat_WriteParamsIniEndDates(), por ejemplo al cambiar el color de la gráfica de accesos por día y hora, no se respeta la zona horaria.
|
||||||
*/
|
*/
|
||||||
#define Log_PLATFORM_VERSION "SWAD 20.54 (2021-03-30)"
|
#define Log_PLATFORM_VERSION "SWAD 20.55 (2021-04-04)"
|
||||||
#define CSS_FILE "swad20.45.css"
|
#define CSS_FILE "swad20.45.css"
|
||||||
#define JS_FILE "swad20.6.2.js"
|
#define JS_FILE "swad20.6.2.js"
|
||||||
/*
|
/*
|
||||||
TODO: Rename CENTRE to CENTER in help wiki.
|
TODO: Rename CENTRE to CENTER in help wiki.
|
||||||
TODO: Rename ASSESSMENT.Announcements to ASSESSMENT.Calls_for_exams
|
TODO: Rename ASSESSMENT.Announcements to ASSESSMENT.Calls_for_exams
|
||||||
|
|
||||||
|
Version 20.55: Apr 04, 2021 Optimizations in database selects. (309500 lines)
|
||||||
Version 20.54: Mar 30, 2021 Statistics about agendas. (309539 lines)
|
Version 20.54: Mar 30, 2021 Statistics about agendas. (309539 lines)
|
||||||
Version 20.53.1: Mar 30, 2021 Optimizations in database selects. (309459 lines)
|
Version 20.53.1: Mar 30, 2021 Optimizations in database selects. (309459 lines)
|
||||||
Version 20.53: Mar 29, 2021 Code refactoring in database selects. (309473 lines)
|
Version 20.53: Mar 29, 2021 Code refactoring in database selects. (309473 lines)
|
||||||
|
|
|
@ -3793,15 +3793,53 @@ unsigned long DB_QuerySELECT (MYSQL_RES **mysql_res,const char *MsgError,
|
||||||
int NumBytesPrinted;
|
int NumBytesPrinted;
|
||||||
char *Query;
|
char *Query;
|
||||||
|
|
||||||
|
/***** Create query string *****/
|
||||||
va_start (ap,fmt);
|
va_start (ap,fmt);
|
||||||
NumBytesPrinted = vasprintf (&Query,fmt,ap);
|
NumBytesPrinted = vasprintf (&Query,fmt,ap);
|
||||||
va_end (ap);
|
va_end (ap);
|
||||||
if (NumBytesPrinted < 0) // -1 if no memory or any other error
|
if (NumBytesPrinted < 0) // -1 if no memory or any other error
|
||||||
Lay_NotEnoughMemoryExit ();
|
Lay_NotEnoughMemoryExit ();
|
||||||
|
|
||||||
|
/***** Do SELECT query *****/
|
||||||
return DB_QuerySELECTusingQueryStr (Query,mysql_res,MsgError);
|
return DB_QuerySELECTusingQueryStr (Query,mysql_res,MsgError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/*** Make a SELECT query for a unique row with one long code from database ***/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
long DB_QuerySELECTCod (const char *MsgError,
|
||||||
|
const char *fmt,...)
|
||||||
|
{
|
||||||
|
MYSQL_RES *mysql_res;
|
||||||
|
va_list ap;
|
||||||
|
int NumBytesPrinted;
|
||||||
|
char *Query;
|
||||||
|
long Cod;
|
||||||
|
|
||||||
|
/***** Create query string *****/
|
||||||
|
va_start (ap,fmt);
|
||||||
|
NumBytesPrinted = vasprintf (&Query,fmt,ap);
|
||||||
|
va_end (ap);
|
||||||
|
if (NumBytesPrinted < 0) // -1 if no memory or any other error
|
||||||
|
Lay_NotEnoughMemoryExit ();
|
||||||
|
|
||||||
|
/***** Do SELECT query *****/
|
||||||
|
if (DB_QuerySELECTusingQueryStr (Query,&mysql_res,MsgError)) // Row found
|
||||||
|
Cod = DB_GetNextCod (mysql_res);
|
||||||
|
else
|
||||||
|
Cod = -1L;
|
||||||
|
|
||||||
|
/***** Free structure that stores the query result *****/
|
||||||
|
DB_FreeMySQLResult (&mysql_res);
|
||||||
|
|
||||||
|
return Cod;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/*********** Make a SELECT query from database using query string ************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
static unsigned long DB_QuerySELECTusingQueryStr (char *Query,
|
static unsigned long DB_QuerySELECTusingQueryStr (char *Query,
|
||||||
MYSQL_RES **mysql_res,
|
MYSQL_RES **mysql_res,
|
||||||
const char *MsgError)
|
const char *MsgError)
|
||||||
|
|
|
@ -41,6 +41,8 @@ void DB_BuildQuery (char **Query,const char *fmt,...);
|
||||||
|
|
||||||
unsigned long DB_QuerySELECT (MYSQL_RES **mysql_res,const char *MsgError,
|
unsigned long DB_QuerySELECT (MYSQL_RES **mysql_res,const char *MsgError,
|
||||||
const char *fmt,...);
|
const char *fmt,...);
|
||||||
|
long DB_QuerySELECTCod (const char *MsgError,
|
||||||
|
const char *fmt,...);
|
||||||
long DB_GetNextCod (MYSQL_RES *mysql_res);
|
long DB_GetNextCod (MYSQL_RES *mysql_res);
|
||||||
unsigned long DB_GetNumRowsTable (const char *Table);
|
unsigned long DB_GetNumRowsTable (const char *Table);
|
||||||
unsigned long DB_QueryCOUNT (const char *MsgError,const char *fmt,...);
|
unsigned long DB_QueryCOUNT (const char *MsgError,const char *fmt,...);
|
||||||
|
|
Loading…
Reference in New Issue