Reply to Re: from mysql to php

Your name:

Reply:


Posted by J.O. Aho on 01/19/07 18:34

Lorenzo Bettini wrote:

> What I do now is change the structure from phpmyadmin, copy the sql code
> that phpmyadmin writes into a an sql file and tell the users to update
> the database with that file (using a mysql command line).

> I was looking for a more friendly way (say a page update.php) that
> automatically checks the difference between the current version of the
> database structure and the new one (when a new release of the software
> is shipped).

This is a page you have to write yourself, you can check if the tables has
those changes you are supposed to have if the tables are up to date, if there
is a fail, then you know you need to make the update, to make the update.php
to handle different versions of your db design you have to check things one at
the time.


> Possibly, I'd like to avoid writing these things manually, and have
> these procedures generated automatically.

As there are so many small things you can change, it's difficult to make a
good general script (don't say it's impossible or anything like that), it's a
lot easier to make your own update scripts. Myself I have always done a php
file that can be run easily without any sql skills.

You can even take this a level higher and include checks in the regular php
code that checks if the database is up to date if a sql query fails, if it
notice that the database isn't of the right format, it updates the database
and then redo the sql query, this way the user don't have to run any
update.php or run a sql file.

--

//Aho

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация