Subversion Repositories SmartDukaan

Rev

Rev 2135 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2135 Rev 2153
Line 145... Line 145...
145
  def loadSearchStringsFromDb(self):
145
  def loadSearchStringsFromDb(self):
146
    conn = self.getDbConnection()
146
    conn = self.getDbConnection()
147
    
147
    
148
    # Prepare SQL query to INSERT a record into the database.
148
    # Prepare SQL query to INSERT a record into the database.
149
    # sql = "SELECT query FROM query where is_active = 1"
149
    # sql = "SELECT query FROM query where is_active = 1"
150
    sql = "SELECT * FROM query where is_active = 1 and id%2 = dayofweek(now())%2"
150
    sql = "SELECT query FROM query where is_active = 1 and id%2 = dayofweek(now())%2"
151
    try:
151
    try:
152
      # prepare a cursor object using cursor() method
152
      # prepare a cursor object using cursor() method
153
      cursor = conn.cursor()
153
      cursor = conn.cursor()
154
      # Execute the SQL command
154
      # Execute the SQL command
155
      cursor.execute(sql)
155
      cursor.execute(sql)