mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-11-26 15:20:29 +01:00
2018-07-12 Fred Gleason <fredg@paravelsystems.com>
* Cleaned up SQL quieries in 'lib/' ensure UTF-8 compatibility.
This commit is contained in:
@@ -23,9 +23,6 @@
|
||||
#include <rdcatch_conf.h>
|
||||
#include <rdescape_string.h>
|
||||
|
||||
//
|
||||
// Global Classes
|
||||
//
|
||||
RDCatchConf::RDCatchConf(const QString &station)
|
||||
{
|
||||
RDSqlQuery *q;
|
||||
@@ -33,15 +30,13 @@ RDCatchConf::RDCatchConf(const QString &station)
|
||||
|
||||
air_station=station;
|
||||
|
||||
sql=QString().
|
||||
sprintf("select ID from RDCATCH where STATION=\"%s\"",
|
||||
(const char *)air_station);
|
||||
sql=QString("select ID from RDCATCH where ")+
|
||||
"STATION=\""+RDEscapeString(air_station)+"\"";
|
||||
q=new RDSqlQuery(sql);
|
||||
if(!q->first()) {
|
||||
delete q;
|
||||
sql=QString().
|
||||
sprintf("insert into RDCATCH set STATION=\"%s\"",
|
||||
(const char *)air_station);
|
||||
sql=QString("insert into RDCATCH set ")+
|
||||
"STATION=\""+RDEscapeString(air_station)+"\"";
|
||||
q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
} else {
|
||||
@@ -73,11 +68,9 @@ void RDCatchConf::SetRow(const QString ¶m,const QString &value) const
|
||||
RDSqlQuery *q;
|
||||
QString sql;
|
||||
|
||||
sql=QString().
|
||||
sprintf("UPDATE RDCATCH SET %s=\"%s\" WHERE STATION=\"%s\"",
|
||||
(const char *)param,
|
||||
(const char *)RDEscapeString(value),
|
||||
(const char *)RDEscapeString(air_station));
|
||||
sql=QString("update RDCATCH set ")+
|
||||
param+"=\""+RDEscapeString(value)+"\" where "+
|
||||
"STATION=\""+RDEscapeString(air_station)+"\"";
|
||||
q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user