Thanks for the reply. But i'm very new to php, so let me go one step
at a time.
HABTM in my understanding is to create cross reference tables. (If i'm
not right, please correct me)
But my case is as follows:
Events is a master table where eventcategoryid is a foreign key
column (which comes from Eventcategory master).
First i want to make the dropdown display workable properly.
dropdown is displayed, but for each record there are 3 records in the
drop down (1. label, 2. category name and 3. category id) whereas it
should be just categoryname as text and id as value.
I tried
$this->set('eventcategories', $this->Event->EventCategory-
>find('list')); (instead of find('all') which works without error.)
but if i use 'list' it throws following error:
SQL Error: 1064: You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right
syntax to use near 'FROM `event_categories` AS `EventCategory` WHERE
1 = 1' at line 1 [CORE\cake\libs\model\datasources\dbo_source.php,
line 666]
Query: SELECT `EventCategory`.`id`, EventCategory. FROM
`event_categories` AS `EventCategory` WHERE 1 = 1
its missing eventcategory.categoryname, but i donno y its happening..
Thanks in advance
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
To unsubscribe, reply using "remove me" as the subject.
No comments:
Post a Comment