My gut instinct is screaming that you should not be creating multiple
tables as that goes against database normalisation and results in
duplicate tables, models, controllers and views.
Why would a small add not have a value for size, location and
user_id?
- I would expect by the very fact you're c
Hi,
I think you need to try Tree behavior, please have a look at
http://book.cakephp.org/view/1339/Tree
Hope this helps.
Amit Badkas
PHP Applications for E-Biz: http://www.sanisoft.com
On Thu, Jan 20, 2011 at 1:14 PM, josef corley wrote:
> Howdy. ^^
>
> I'm a noob at this so, please bear w
cricket was right :D ty
On Jul 8, 9:56 pm, duderion wrote:
> hi guys,
>
> thanks alot for all your help
>
> i could solve the problem like
> this:http://book.cakephp.org/view/851/Multiple-relations-to-the-same-model
>
> tx alot :D
> duderion
>
> On 6 Jul., 19:42, bladefarm wrote:
>
>
>
> > hi p
hi guys,
thanks alot for all your help
i could solve the problem like this:
http://book.cakephp.org/view/851/Multiple-relations-to-the-same-model
tx alot :D
duderion
On 6 Jul., 19:42, bladefarm wrote:
> hi pips!
> i need ur help.
> i'v got 2 models: prospects and programs.
> prospects saves re
hi pips!
i need ur help.
i'v got 2 models: prospects and programs.
prospects saves records of prospects for one or more programs while
programs have records of the different disciplines offered.
the prospects model looks like this:
create table prospects(
... ,
... ,
program_first_id int(11
On Tue, Jul 6, 2010 at 4:26 AM, dtemes wrote:
> I would not use cascade delete on sender_id, once a mail is in your
> box it's yours and it can contain important information that should
> not be "stolen" from you even if the user that sent it is not there
> any more.
Good point!
Check out the ne
I would not use cascade delete on sender_id, once a mail is in your
box it's yours and it can contain important information that should
not be "stolen" from you even if the user that sent it is not there
any more.
On 5 jul, 20:52, cricket wrote:
> On Mon, Jul 5, 2010 at 10:17 AM, duderion wrote:
On Mon, Jul 5, 2010 at 10:17 AM, duderion wrote:
> Hi Guys
>
> i have a question about cake compatible database design:
>
> i have a table "mails" and a table "users"
>
> my table mail references 2 users from the users-table as Sender,
> Recipient
>
> but then, i have 2 foreign keys in it, and i d
John Andersen has it right with the 3 Controller, 4 Model approach.
jacmoe almost got there, but saw something shiny and wandered off the
path.
On Oct 31, 3:50 am, John Andersen wrote:
> First of all - I suggest you drop the table_singular_name_id format
> for your tables primary key and use the
You have quite an ambitious project. What you are wanting to create is
an integrated ERP system. Now you have the individual pieces but want
them integrated.
Is this system feasible in CakePHP? Absolutely! One database with
multiple tables would be fine, IMHO. (Even when developing on a
mainframe
First:
Database names are plural:
students, courses, assignments, marks.
The models would then be Student, Course, Assignment and Mark.
The id of each database should be just 'id'.
Because that's what CakePhp likes, and because it's convention to name
*foreign keys* like this:
tablename_id - s
Other thing depending on requirements is this will weight the test
scores equally u may have need that if result is only a smaller
percent of the course total grade
On 10/30/09, John Andersen wrote:
>
> First of all - I suggest you drop the table_singular_name_id format
> for your tables prima
First of all - I suggest you drop the table_singular_name_id format
for your tables primary key and use the CakePHP expected primary key,
which is just named "id" - nothing else! That will make your life
easier!
Playing with your tables and relationships:
Student hasAndBelongsToMay Course - and v
Jack,
You will need another table to tie it all together. Something like:
Students_Courses
student_id
course_id
assignment_id
mark_id
I'm new to CakePHP so this might not be the best way to accomplish
this via Cake.
Patrick
On Fri, Oct 30, 2009 at 6:11 AM, japaternoster
wrote:
>
>
Thanks for that hint with the condition. I edited my models
accordingly and it works as expected
regards,
harpax
On 27 Mai, 15:27, Martin Westin wrote:
> I would choose separate tables for comments, shoutbox and guestbook.
> The reason is that one day soon you might come up with an idea to
> ex
I would choose separate tables for comments, shoutbox and guestbook.
The reason is that one day soon you might come up with an idea to
expand the guestbook and then you will curse being locked in with the
other models.
For flexibility and reuse of code there is nothing stopping you from
Creating
First, sorry my bad English...
Well, you could have a field "type" that reference the entity that has
the commentary. Pattern Single Table.
Braindead wrote:
> Well, my problem is not directly related to CakePHP, but as it's about
> database design maybe I'll get some good answers.
>
> On my p
we do this with an type column.
On May 27, 9:22 am, Braindead wrote:
> Well, my problem is not directly related to CakePHP, but as it's about
> database design maybe I'll get some good answers.
>
> On my page I have news, downloads and users. These three can be
> commented. Additionally I have a
we do this with an type column.
On May 27, 9:22 am, Braindead wrote:
> Well, my problem is not directly related to CakePHP, but as it's about
> database design maybe I'll get some good answers.
>
> On my page I have news, downloads and users. These three can be
> commented. Additionally I have a
Hello group,
I have a similar question:
I got 2 models, that are almost identical - the only difference is,
that they have a belongsTo field, that is linked to different models.
Controllers and views are all the same, so I think to really use two
models is not very DRY. The models
post_reminder
If I believe what you are saying, something like this would work (not
sure what fields you need):
// all the tenants
tenants
- id
- name
// all the expenses
expenses
- id
- cost
// relating a tenant to an expense = multiple tenants possible on an
expense
tenantExpenseRelation
- id
- tenant_id
-
On Thu, Oct 2, 2008 at 5:13 PM, ORCC <[EMAIL PROTECTED]> wrote:
> [..snip..]
>
> Id City_Id Property Value
> 11 "greeting" "HELLO"
> 22 "greeting" "HOLA"
> 33 "greeting" "CIAO"
> 41 "contact""[EMAIL PROTECTED]"
> 52
I suggest you to:
- Create a single table Cities (id,name). For example
IdName
1 New York
2 Madrid
3 Roma
- Create a single table called Properties (id,city_id, property,
value) and place in that table All the properties for each city. For
instance:
Id City_Id Property Value
How do you determine if an image is invalid?
You may be able to apply this criteria to your SELECT statement
without any additional fields.
On Jan 27, 2:50 pm, Takuo SHIONO <[EMAIL PROTECTED]> wrote:
> Hello,
>
> If you do not want to keep unnecessary fields for almost 50% of images,
> you can u
Hello,
If you do not want to keep unnecessary fields for almost 50% of images,
you can use image_link table, which contains 3 fields(image_id, next_id,
previous_id). You maintain this table in afterSave function only when
you edit or add valid images.
You can define the HASONE relationship be
On Jan 27, 11:33 am, "Novice Programmer" <[EMAIL PROTECTED]>
wrote:
> Hello AD,
>
> Wont this query be slow?
No.
> Lets say that i have first valid image at index 1
> and the next one at the index 1000. How would this query perform?
SELECT * from images WHERE status = 1 AND id > $thisOne ORDE
Hello Shiono,
When i tried to add the two fields, it seemed like an overhead to me because
almost 50% of the images would be invalid, so adding two fields to database
design will lead to addition of these fields in these invalid images as well
and hence occupy more space in database. I want to avo
Hello AD,
Wont this query be slow? Lets say that i have first valid image at index 1
and the next one at the index 1000. How would this query perform?
Thanks.
On 1/27/08, AD7six <[EMAIL PROTECTED]> wrote:
>
>
>
>
> On Jan 26, 8:33 pm, "Novice Programmer" <[EMAIL PROTECTED]>
> wrote:
> > Though
On Jan 26, 8:33 pm, "Novice Programmer" <[EMAIL PROTECTED]>
wrote:
> Though this is less of a database question. but i am still posting it here
> since I think we can discuss the design as well.. :).
>
> I am maintaining a adresses of images stored on my filesystem in a database.
> I have design
Hello,
I often use solution 1. I think this solution can be applied in almost
all cases. However I have another solution. How about this:
1. add 2 fields (prev_valid_index and next_valid_index) in table.
2. update these fields in afterSave function.
3. show image with the next/previous link acc
On Jan 25, 2008, at 3:11 PM, judouk wrote:
>
> ///sorry, gmail let me post it first before I'd finished and now
> that I've had the time to rethink what I was typing, I think I've
> solved my own problem !
>
>
> CREATE TABLE jobs (
> id int(10) not null auto_increment,
> typeofjob varch
You can use the module code as the PK, but if it has characters in as well, it
may provide a few more headaches for you in the end.
Personally I stick with ID as it is easier to remember what cake is up to.
so [omitting the likes of created and modified and other details):
modules (id, title,.
I would go with an id field that is an auto-increment and a code field
for storing your code numbers.
Winston
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to ca
Ok an update on this for anybody that cares (if anybody cares ;) ). One
mistake I made cakewise was having the join table divisions_dances
misnamed it should be dances_divisions (alphebetical order). Dbdesigner
had added (and insists that they be there) some ids to the join table
that really aren'
34 matches
Mail list logo