Saturday 15 June 2013

symfony - Which is the best way to maintain the two table values? -


I have two tables like

  User ID name count 1 cat 2 2 dog 1 3 Rabbit 1 4 Tiger 0 Text ID Time Student 1 09:00 1 (Cat) 2 10:00 1 (Cat) 3 13:00 2 (Dog) 4 15:00 3 (Rabbit)   

User.count means how each user displays in the lesson table. I want to keep this number correctly.

Method A)

You can increase the user's data with PHP every time when you add a row to the text but you have to type the cords when you enter a line for the text Add or Remove a Line from Text

Method B) Using Preparest or Preappet (I'm using Principle 2) but it is possible to use the User table when the PreUupate text unit Has started?

Method C)

Can you connect to some mysql native method?

What is the best way to maintain these values ​​??

  • You can not get other tables / entities in the tasks such as preprisonist / postpresist.
  • You should not use the basic database access function.

    You should make more service oriented applications. I believe that you add a new lesson to your controllers by doing the following:

      $ theory- gt; GetManager-> Continues ($ newLesson);   

    Instead of doing so, you should create a service that will merge and counting for you will be something like LessonService with the following method:

      public functions addLesson ($ lessonModel) {// Add database to text // Increase here at counter}    

No comments:

Post a Comment