diff --git a/weather_parser.inc b/weather_parser.inc
index 3ff9e4a..a1f629e 100644
--- a/weather_parser.inc
+++ b/weather_parser.inc
@@ -77,13 +77,13 @@ function weather_get_forecasts_from_database($geoid, $utc_offset, $days, $detail
   else {
     if ($days > 1) {
       $forecasts = db_query(
-        'SELECT * FROM {weather_forecasts} WHERE geoid = :geoid AND time_from >= :tomorrow_local_time AND period = 2 AND time_from <= :forecasts_until_local_time ORDER BY time_from ASC',
+        'SELECT * FROM {weather_forecasts} WHERE geoid = :geoid AND time_from >= :tomorrow_local_time AND period = \'2\' AND time_from <= :forecasts_until_local_time ORDER BY time_from ASC',
         array(':geoid' => $geoid, ':tomorrow_local_time' => $tomorrow_local_time, 'forecasts_until_local_time' => $forecasts_until_local_time));
       $weather = array_merge($weather, _weather_create_weather_array($forecasts));
     }
     elseif ($days == 0) {
       $forecasts = db_query(
-        'SELECT * FROM {weather_forecasts} WHERE geoid = :geoid AND time_from >= :tomorrow_local_time AND period = 2 ORDER BY time_from ASC',
+        'SELECT * FROM {weather_forecasts} WHERE geoid = :geoid AND time_from >= :tomorrow_local_time AND period = \'2\' ORDER BY time_from ASC',
         array(':geoid' => $geoid, ':tomorrow_local_time' => $tomorrow_local_time));
       $weather = array_merge($weather, _weather_create_weather_array($forecasts));
     }
