Yii Framework Forum: Another Does Yii Allow To Create (Mysql) Database And Tables Dynamically ? - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Another Does Yii Allow To Create (Mysql) Database And Tables Dynamically ? Rate Topic: -----

#1 User is offline   joppo20 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 22-October 13

Posted 24 October 2013 - 03:31 PM

Hi,

I'm just learning about Yii. I was wondering whether Yii allows to create (mysql) database and tables dynamically (for example based on a submitted webform by means of a controller)?

Appreciate your feedback

Regards
Joppo20
0

#2 User is offline   yugene 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 513
  • Joined: 08-August 09

Posted 24 October 2013 - 08:00 PM

Yii is just a convenient way to organize your project with common functionalities and libraries provided out of the box. So it allows you to do anything you may do with plain php, js and db of your choice.
Have you read description how to work with database yet? You're highly encouraged to read whole yii guide as it describes all the basic framework approaches and functionalities.
0

#3 User is offline   Da:Sourcerer 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,222
  • Joined: 30-March 11
  • Location:Berlin, Germany

Posted 25 October 2013 - 03:05 AM

View Postjoppo20, on 24 October 2013 - 03:31 PM, said:

I was wondering whether Yii allows to create (mysql) database and tables dynamically (for example based on a submitted webform by means of a controller)?

As a matter of fact, it does. However, you shouldn't do this unless you are building a database administration tool like phpMyAdmin or chive, you really shouldn't.
programmer /ˈprəʊgramə/, noun: a device that converts ►coffee into ►code
0

#4 User is offline   joppo20 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 22-October 13

Posted 25 October 2013 - 03:16 AM

Hi Yugene ,

Thanks for your reply. I have not read the entire manual yet (this is my 3rd day of reading about Yii), but I did read some of the tutorials, some of manual and searched for related topics on the forum.

If I understand correctly - for one creating dynamic databases one -e.g. some controller code- has to :
1. create the database and table (using plain php pdo code; that's easy)
2. edit the application configuration file in the protected directory
3.call the Gii tool to create the models for the table

The tutorials show how to edit the app config file and use the Gii tool manually, but I struggle to understand (/have not seen any example ) how controller code could perform these steps (2,3) automatically? Or do I miss something and do I take the wrong approach? (ps: the databases I need to create have all the same kind of tables but with different content )

regards
Joppo20
0

#5 User is offline   joppo20 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 22-October 13

Posted 25 October 2013 - 12:26 PM

thnx Da:Sourcerer for your advice. my conclusion, what i already suspected is that in that case Yii is not suitable with respect to my system requirements. Nevertheless I 'm very impressed by Yii and hope to experiment with it for another design in the future.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users