Fuel\Core\Database_Exception [ 23000 ]:
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'rss_id' cannot be null with query: "INSERT INTO `clicks` (`rss_id`) VALUES (null)"
248 { 249 $error_code = 0; 250 } 251 } 252 253 throw new \Database_Exception($e->getMessage().' with query: "'.$sql.'"', $error_code, $e); 254 } 255 } 256 257 // no more attempts left, bail out 258 else
309 catch (\CacheNotFoundException $e) {} 310 } 311 312 // Execute the query 313 \DB::$query_count++; 314 $result = $db->query($this->_type, $sql, $this->_as_object); 315 316 // Cache the result if needed 317 if (isset($cache) and ($this->_cache_all or $result->count())) 318 { 319 $cache->set_expiration($this->_lifetime)->set_contents($result->as_array())->set();
13 $data = $query->execute()->as_array(); 14 return $data; 15 } 16 public static function InsertClick($rssId){ 17 DB::insert('clicks')->set(array('rss_id'=>$rssId)) 18 ->execute(); 19 } 20}
92 //rssのIDを取得 93 $rssId = Input::get('rssId'); 94 $url = Input::get('url'); 95 96 //DBにデータを書き込み、リダイレクト 97 \Model\GetRssInfo::InsertClick($rssId); 98 Response::redirect($url); 99 } 100 /** 101 * The 404 action for the application. 102 *
449 // fire any controller started events 450 \Event::instance()->has_events('controller_started') and \Event::instance()->trigger('controller_started', '', 'none'); 451 452 $class->hasMethod('before') and $class->getMethod('before')->invoke($this->controller_instance); 453 454 $response = $action->invokeArgs($this->controller_instance, $this->method_params); 455 456 $class->hasMethod('after') and $response = $class->getMethod('after')->invoke($this->controller_instance, $response); 457 458 // fire any controller finished events 459 \Event::instance()->has_events('controller_finished') and \Event::instance()->trigger('controller_finished', '', 'none');
66 $response = Response::forge($response); 67 } 68 } 69 elseif ($e === false) 70 { 71 $response = Request::forge()->execute()->response(); 72 } 73 elseif ($route) 74 { 75 $response = Request::forge($route, false)->execute(array($e))->response(); 76 }
87{ 88 // Boot the app... 89 require APPPATH.'bootstrap.php'; 90 91 // ... and execute the main request 92 $response = $routerequest(); 93} 94catch (HttpBadRequestException $e) 95{ 96 $response = $routerequest('_400_', $e); 97}