tag:blogger.com,1999:blog-5160921211805958415.post4357328996926271337..comments2024-02-27T20:55:10.139-08:00Comments on Kohana Framework Tutorial: Lesson 2 - Database and ModelsAquilaXhttp://www.blogger.com/profile/00163681558256875339noreply@blogger.comBlogger10125tag:blogger.com,1999:blog-5160921211805958415.post-85743316463342291782023-11-29T04:18:11.408-08:002023-11-29T04:18:11.408-08:00Thanks for sharing this informative blog.
Looking ...Thanks for sharing this informative blog.<br />Looking for <a href="https://www.oldbungalowooty.com/contact-us/" rel="nofollow">Low budget cottages in Ooty</a>? Experience a pocket-friendly getaway amidst nature's beauty with our affordable and charming retreat in Ooty.Neeleshhttps://www.blogger.com/profile/07070533262741203131noreply@blogger.comtag:blogger.com,1999:blog-5160921211805958415.post-89465719005339626652011-12-27T18:45:27.010-08:002011-12-27T18:45:27.010-08:00Perhaps I missed something somewhere along the way...Perhaps I missed something somewhere along the way to get the model loaded (I'm using v3.2) but I had to change the action_index() model in the news controller to be:<br /><br />public function action_index() {<br /> $model = Model::factory('News');<br /> $this->data['news'] = $model->loadFirstPageNews(30);<br /> $this->render();<br />}Brianhttps://www.blogger.com/profile/16666968615138900415noreply@blogger.comtag:blogger.com,1999:blog-5160921211805958415.post-21572256844544592102011-11-18T06:11:40.202-08:002011-11-18T06:11:40.202-08:00problem solved ... I just added new user with all ...problem solved ... I just added new user with all permission and access .. I don't know why It didn't work on basic root without password :) thanks..Lucas Fhttps://www.blogger.com/profile/11500519217083072936noreply@blogger.comtag:blogger.com,1999:blog-5160921211805958415.post-81542886457986368132011-11-18T05:07:26.736-08:002011-11-18T05:07:26.736-08:00Another problem..
http://imageshack.us/photo/my-i...Another problem..<br /><br />http://imageshack.us/photo/my-images/42/23557806.jpg/Lucas Fhttps://www.blogger.com/profile/11500519217083072936noreply@blogger.comtag:blogger.com,1999:blog-5160921211805958415.post-28552978010400263432011-11-18T04:35:08.123-08:002011-11-18T04:35:08.123-08:00Problem solved .. AquilaX it should be Database_Ex...Problem solved .. AquilaX it should be Database_ExpressionLucas Fhttps://www.blogger.com/profile/11500519217083072936noreply@blogger.comtag:blogger.com,1999:blog-5160921211805958415.post-53884437017968571972011-11-18T04:16:19.232-08:002011-11-18T04:16:19.232-08:00Next Error: APPPATH\classes\model\news.php
ErrorEx...Next Error: APPPATH\classes\model\news.php<br />ErrorException [ Fatal Error ]: Class 'DatabaseExpression' not found<br /><br />http://imageshack.us/f/522/53899541.jpg/Lucas Fhttps://www.blogger.com/profile/11500519217083072936noreply@blogger.comtag:blogger.com,1999:blog-5160921211805958415.post-49438988792717290012011-11-18T03:37:22.100-08:002011-11-18T03:37:22.100-08:00Also check the Controller code here: http://code.g...Also check the Controller code here: http://code.google.com/p/kohana-tutorial/source/browse/trunk/kohana/knh/application/classes/controller/news.phpAquilaXhttps://www.blogger.com/profile/00163681558256875339noreply@blogger.comtag:blogger.com,1999:blog-5160921211805958415.post-49941329619879598662011-11-18T03:27:24.368-08:002011-11-18T03:27:24.368-08:00@Lucas the code goe to the news.php model:
applica...@Lucas the code goe to the news.php model:<br />application/classes/model/news.php<br /><br />Check the whole model here:<br />https://gist.github.com/1376219AquilaXhttps://www.blogger.com/profile/00163681558256875339noreply@blogger.comtag:blogger.com,1999:blog-5160921211805958415.post-80929871373804289122011-11-18T03:19:50.876-08:002011-11-18T03:19:50.876-08:00I want to say I'm working in 3.08. Kohana like...I want to say I'm working in 3.08. Kohana like you were working. <br /><br />I think it's should be in: <br />application/classes/model/news.php<br /><br />Then I made 2 last steps and I have error:<br /><br />http://imageshack.us/photo/my-images/191/41213026.jpg/<br /><br />undefinied property.. I think it's this 30Lucas Fhttps://www.blogger.com/profile/11500519217083072936noreply@blogger.comtag:blogger.com,1999:blog-5160921211805958415.post-18221720138079348372011-11-17T13:15:36.798-08:002011-11-17T13:15:36.798-08:00Hello!
I have problem. I don't know where put ...Hello!<br />I have problem. I don't know where put this code from this: <br />"Let's also add a method to get all the news for the home page: <br /><br />/*<br /> * Load the news for the first page<br /> */<br /> public function loadFirstPageNews($n){<br /> return DB::select('id', 'title', 'user_id', 'user_name', 'comments', 'points', new Database_Expression('UNIX_TIMESTAMP(created) AS created'))<br /> ->from('news')<br /> ->order_by(new DatabaseExpression('(points - 1) / ((UNIX_TIMESTAMP(CURRENT_TIMESTAMP)-UNIX_TIMESTAMP(created))/3600 +2)^1.5'), 'DESC')<br /> ->order_by('created')<br /> ->limit($n)<br /> ->execute()<br /> ->as_array();<br /> }<br /><br /><br /> "Lucas Fhttps://www.blogger.com/profile/11500519217083072936noreply@blogger.com