Changeset 15634

Show
Ignore:
Timestamp:
22.05.2008 13:54:32 (11 years ago)
Author:
mdewsnip
Message:

(Adding new DB support) Adding quick implementation of exists().

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/lib/sqliteclass.cpp

    r15633 r15634  
    111111bool sqliteclass::exists(const text_t& key) 
    112112{ 
    113   // !! TO IMPLEMENT 
    114   return false; 
     113  text_t sql_cmd = "SELECT value FROM data WHERE key='" + key + "'"; 
     114  vector<text_tmap> sql_results; 
     115  if (sqlitefile == NULL || !sqlgetarray(sql_cmd, sql_results) || sql_results.size() == 0) 
     116  { 
     117    return false; 
     118  } 
     119 
     120  return true; 
    115121} 
    116122