#4 querying menu sturcture from a database

closed
nobody
None
5
2003-04-05
2003-01-21
Anonymous
No

I'm trying to figure out how to query the structure
from a database (e.g. MySQL) and implode it into string
to work with PHP Layers Menu... Any help is very
appreciated.

Thanks

Discussion

  • Marco Pratesi

    Marco Pratesi - 2003-01-21

    Logged In: YES
    user_id=65709

    I have not included anything like this in the package
    because IMHO a menu class should not care about
    where data come from and should only define a clear
    menu structure format (i.e. a well defined data format);
    however, as there are people that ask for this feature
    (you are not the first one, absolutely ;-) I'm meditating
    about including it in this development branch.

    However, go to
    http://ftp1.sourceforge.net/pgmarket/
    and download version 2.3.0.
    Then look at

    lib/mysql_layersmenu_queries.inc.php
    lib/mysql_treemenu_queries.inc.php
    lib/pgsql_layersmenu_queries.inc.php
    lib/pgsql_treemenu_queries.inc.php

    and at the categories table layout in

    DUMPS/mysql.start.dump
    DUMPS/pgsql.start.dump

    you can do something similar.
    If you need some comments about the code I have cited
    and about how it works, let me know.

    Marco Pratesi

     
  • Marco Pratesi

    Marco Pratesi - 2003-02-09

    Logged In: YES
    user_id=65709

    You can find such an implementation in the development version
    I have just released, i.e. 2.3.3, that provides also an example.
    This implementation directly fills the object variables without
    the need of preparing a menu structure string that should be
    subsequently parsed to fill the named object variables; this
    approach should allow to obtain better performance w.r.t.
    the solution I have proposed in my previous message.
    Please read the changelog for more details.

    Marco Pratesi

     
  • Marco Pratesi

    Marco Pratesi - 2003-04-05
    • status: open --> closed
     
  • Marco Pratesi

    Marco Pratesi - 2003-04-05

    Logged In: YES
    user_id=65709

    Due to the lack of feedback for more than one month,
    I'm closing this support request.

    Marco Pratesi

     

Log in to post a comment.