4

I'm building a zend application.I was wondering if I can build mysql tables programmatically without using phpmyadmin.I would want to build them in the act of setting up my web application.If I'm not wrong you can do this in Symfony.

Thanks

Luca

2
  • 2
    what's your situation where you'd want to dynamically create mysql tables at runtime? Commented Jun 30, 2011 at 11:21
  • Let's say I'm setting up my application..I set my .ini file,my bootstrap and my models ecc. Ex I have built "Games" class extending Zend_Db_Table_Abstract.Now I would need to go over phpmyadmin and "manually" build "Games" table..How can I do this whitout using phpmyadmin? Commented Jun 30, 2011 at 11:37

3 Answers 3

1

You should look into doctrine.

Lots of info on the web about integrating doctrine with zf. Check out [zend casts for some good tuts. G'luck

Sign up to request clarification or add additional context in comments.

Comments

1

Try

$dbAdapter->query('CREATE TABLE myTable ...');

That should work fine, I guess.

Comments

0

Why not put your schema creation SQL into a file and run it as part of the web app installation?

1 Comment

Create a sql file, it should contain SQL table create statements for your tables, triggers, indices etc. I've never used PHPmyadmin but apparently it has a way to export all this for you... superuser.com/questions/168595/… Once you have this in a sql file, your application install script should call mysql with this file, it'll create the schema automatically. For more info on the last part see stackoverflow.com/questions/147821/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.