From f5cb46d5ffa5c46d4b1aa176d9104e8dd67b24ae Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Wed, 30 Mar 2011 16:35:19 +0300 Subject: better --- MainController.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) mode change 100755 => 100644 MainController.php (limited to 'MainController.php') diff --git a/MainController.php b/MainController.php old mode 100755 new mode 100644 index 7b6012e..49a60b5 --- a/MainController.php +++ b/MainController.php @@ -2,13 +2,6 @@ //// // main/MainController.php // @TODO: transfer boeuf.php here - -/* This program is free software. It comes without any warranty, to - * the extent permitted by applicable law. You can redistribute it - * and/or modify it under the terms of the Do What The Fuck You Want - * To Public License, Version 2, as published by Sam Hocevar. See - * http://sam.zoy.org/wtfpl/COPYING for more details. */ - class MainController { public $view; // Where to store the data to be rendered @@ -224,10 +217,11 @@ class MainController `{$table}_{$this->table}`.`{$table}_id` = `$table`.id AND `{$this->table}`.id = ?"; } else if (@in_array($table, $ref_schema['belongsTo'])) { // 1/m - $sql = "SELECT * FROM `$ref` WHERE `$ref`.`{$table}_id` = ?"; + $sql = "SELECT * FROM `$ref` WHERE `$ref`.`{$table}_id` = ?"; } $stmt = MainDb::query($sql, array($id)); + if (!$stmt) { return MainApp::error('Error executing query ' . $sql); } @@ -330,7 +324,8 @@ class MainController //// // update this Thing // We keep this in the Controller since it might know - // more about the topmost class + // more about the topmost class + // return the updated Thing protected function update($data, $where = NULL) { if (!is_array($data)) { -- cgit v1.2.3