Hi Mindchanger,

I will be interested in knowing more about the main requirements
behind this... It looks interesting.

On Feb 9, 1:50 am, "mindcharger" <[EMAIL PROTECTED]> wrote:
> Hi Hawk,
>
> I'm currently developing a system that shares that "dynamic table
> creation" requirement with yours.
> As far as I understand the problem, it's more a DB issue than a CAKE
> issue.
>
> I don't know if it will help you, but I will try to explain how I did
> it.
>
> 1) I have a table on the DB that "describes" the other tables I
> create. To this table I call a "descriptor". Assume it has several
> columns, but one of them is called "table_name".
> 2) Creating a new table encompasses two steps:
>   i) Add a record to the "descriptor" table
>  ii) Create the proper table
> 3) To access the table you must do 2 DB accesses:
>  i) Get all the descriptor records into a HTML select-box or something
> (Ex.: "SELECT table_name FROM descriptors;")
>  ii) Get the chosen table into a var and then acessing the desired
> table
> (Ex.:
> $table_name = <your-favorite-VIEW-data-retrieval-method>;
> $query = "SELECT * FROM $table_name;";
> $data = $this->{MODEL-NAME}->query($query);
> )
>
> The "$data = $this->{MODEL-NAME}->query($query);" allows you to force
> the Model to execute your query.
>
> As for the model, I found that when I want to use this "dynamic table
> device" I have no use for the associated table, so I define:
>
> $useTable=false;
>
> ...on the model.
>
> I hope it helps you. If the explanation was not clear or if you have
> any other doubt feel free to ask me.
>
> Good luck!
>
> On Feb 8, 9:53 am, "Hawk|" <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > i wonder if it would be possible to store the associations in a table
> > instead of storing them in the models/model.php file. So it would be
> > more flexible. I need to create  tables dynamic and associate them on
> > the fly with others and i want to do this without touching the model
> > file itself.
> > Someone allready is using a similar method?
> > or someone has an idea how to do this?.
> > It would be a great help for me to get some response to this issue.
>
> > Thx a lot Hawk.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to