You are here: Re: Question about DB creation... « PHP SQL « IT news, forums, messages
Re: Question about DB creation...

Posted by Manuel Lemos on 09/09/05 05:18

Hello,

on 09/08/2005 06:51 AM morty said the following:
> Heloo I'm looking for some code, module etc...
>
> that will help with creating databases with simple forms.
>
> I need to have functionality :
>
> 1. Create DB
> 2. Create table
> 3. I don't need users permission form
> 4 Create table inheritance
>
> It don't have to be so complicated as for exmple mysql or pgsql admin
>
> And the main problem is that I need taht code working with diffrent
> databases. I fought that maybe with pear i can get such functionality.
>
> I want to add this to seagull framework :)

You may want to try Metabase. That is a database abstraction package
that provides you database independence not only for accessing databases
but also to install the database schema.

The part that I think you will like is that you can create databases
simply by defining their schemas in a simple XML format. Then you just
can Metabase schema manager class and it will install the schema in all
supported databases, which include: MySQL, PostgreSQL, Oracle, Microsoft
SQL server, Informix, Interbase, Microsoft Access via ODBC, SQLite, etc...

You may find Metabase here:

http://www.phpclasses.org/metabase

There is a tutorial here:

http://www.meta-language.net/metabase-tutorial.html


Here is an example schema definition:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<database>

<name>test</name>
<create>1</create>

<table>
<name>users</name>
<declaration>
<field> <name>id</name> <autoincrement>1</autoincrement>
</field>
<field> <name>user_name</name> <type>text</type> </field>
<field> <name>user_password</name> <type>text</type> </field>
<field> <name>reminder</name> <type>text</type> </field>
<field> <name>name</name> <type>text</type> </field>
<field> <name>email</name> <type>text</type> </field>

<index>
<name>user_name_index</name>
<unique>1</unique>
<field> <name>user_name</name> </field>
</index>

</declaration>
</table>

<table>
<name>groups</name>
<declaration>
<field> <name>name</name> <type>text</type> </field>
<field> <name>owner_id</name> <type>text</type> </field>
<field> <name>description</name> <type>text</type> </field>
</declaration>
</table>

<table>
<name>group_users</name>
<declaration>
<field> <name>group_id</name> <type>text</type> </field>
<field> <name>user_id</name> <type>text</type> </field>
</declaration>
</table>

</database>


--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

 

Navigation:

[Reply to this 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

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