FAQ Database Discussion Community


Kohana - get all Tables by using DB::query

php,mysql,kohana
How can i recive all tables listet in my database by using DB::query in Kohana? I won't try mysqli_list_tables or something like this, because have to find a soultion in the framework. The next query just give me the current count of the tables inside the database: $tablesAvailable = DB::query(NULL,...

Add relationship, handling duplicating entries - KOHANA 3.3 [resolved]

php,kohana,kohana-orm,kohana-3.3
I need to add a ROLE relation to a USER. So i did the following: $user->add('roles', $roles_ids_array ); It works, but the system tries to add it without checking if the relation ALREADY EXISTS in the DB, giving me a mysql "Duplicate entry" error. In Kohana 2.x it works perfectly...

What's going on with Kohana Framework?

php,frameworks,kohana
Is Kohana framework alive or not? Development site returns an error when I try to enter it. I can't seem to find Kohana in more or less modern PHP frameworks comparison tables (like this Wikipedia article) I would consider it dead, but there seem to be some life signs in...

Accessing a session variable set in Kohana outside of Kohana

php,session,kohana,kcfinder
I'm trying to use KCFinder with CKEditor and Kohana. I need each user to have access to their own individual upload folder. To do that I want to pass through the current users ID to KCFinder. To do it securely I can't pass it through the URL as a GET...

Kohana 3. Join with multiple condition using OR

join,kohana,query-builder,kohana-3.3
I'm using Kohana Query Builder and trying do next: $query ->join(«t1», «INNER») ->on(«t1.id»,»=»,»t2.parent_id») ->on(«t1.id»,»=»,»t3.x_id») This means: INNER JOIN t1 ON(t1.id = t2.parent_id AND t1.id = t3.x_id) But how force to use OR instead of AND of KO3 query builder join methods? INNER JOIN t1 ON(t1.id = t2.parent_id OR t1.id =...

Kohana Model_Auth_User_Token not getting overridden

php,kohana,kohana-3.3
PDO doesn't support the list_columns function. To get around this when using PDO with Kohana's Auth module, you simply have to list the table names as array keys in an extension of the model class, thusly: <?php defined('SYSPATH') OR die('No Direct Script Access'); class Model_User extends Model_Auth_User { protected $_has_many...

'where' condition in has_many_through in kohana

php,many-to-many,kohana,has-many-through
I have two models Illness and Symptom: Illness class Model_Illness extends ORM { //protected $_db_group = 'default2'; protected $_table_name = 'illnesses'; protected $_has_many = array( 'symptoms' => array( 'through' => 'symptoms_illnesses', 'foreign_key' => 'illness_id', ) ); Symptom class Model_Symptom extends ORM { //protected $_db_group = 'default2'; protected $_table_name = 'symptoms';...

Can't remove whitespaces in string

php,mysql,kohana
My script reads txt file and then writes values into database table. There is a field with price, and in txt file price with 4 digit values have whitespace after first digit (2 500 ex.). I put this function (str_replace works well and replaced ',' but when I use it for...

kohana ORM - add new record for has_many, has_one relationships

orm,kohana,kohana-orm,kohana-3.3
Kohana ORM has the following relationships between model: has_one has_many has_many_through For example, I have the following defined: class Model_ORM_Text extends ORM { protected $_has_one = array( 'compiledData' => array('model' => 'CompiledText', 'foreign_key' => 'idText'), ); protected $_has_many = array( 'translations' => array('model' => 'TextTranslation', 'foreign_key' => 'idText') ); protected...

Facebook login using SDK 4

facebook,login,kohana
I'm trying to make Facebook login for my site. I have Facebook App, I've made AppId, Secred and it is shown facebook login but I can't set session. I'm using facebook-php-sdk-v4-4.0-dev and Kohana Framework. It doesn't show me session data. ErrorException [ Notice ]: Undefined variable: user_profile Please how to...

Facebook login using Kohana

facebook,login,kohana
I'm using Kohana and I'm trying to make facebook login. Where should I place appId in my project? I put it in facebookauth/config/facebook file but it's still showing me previous AppId that I have used. Is there another place that I have to change it? My code in config file...