Re: tree structure problem
On Thu, Sep 23, 2010 at 8:59 AM, marvelade <marvelade@gmail.com> wrote:
> Dear all
>
> For a documentation system we have a tree structure of key words (came
> from an excel file).
>
> it's now in a MySQL table with the following columns (field names are
> pretty self-explanatory)
>
> CREATE TABLE IF NOT EXISTS `keywords` (
> `id` smallint(5) unsigned NOT NULL auto_increment,
> `parent_id` int(10) unsigned default NULL,
> `keyword` varchar(64) collate utf8_unicode_ci NOT NULL,
> `approved` tinyint(1) NOT NULL default '0',
> PRIMARY KEY (`id`)
> )
>
> keywords at root level have parent_id NULL.
>
>
>
> I want to have a system so each keyword can display its chain of
> parents up to the root level
>
> For example I have this chain:
> "Nature sciences" -> "chemistry" -> "analysis methods" -> "gas
> analysis"
>
> When I view keyword "gas analysis" I want my code to display:
>
> Parent chain : "Nature sciences" -> "chemistry" -> "analysis methods"
>
>
> When I follow the procedure as described here:
> http://bakery.cakephp.org/articles/view/threaded-lists
>
> I can't get it to work. I keep getting the 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 'findAllThreaded' at line 1
>
> For some reason the function name findAllThreaded is passed as a SQL
> statement :s
>
>
> Can anyone please advise? I use CakePHP 1.3
That's because the method no longer exists, so Cake simply passes the
request directly to the DB. There have been significant changes to the
Cake libs since that article was posted. Use find('threaded') instead.
Also, check out TreeBehavior:
http://book.cakephp.org/view/91/Tree
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

0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home