Welcome Guest, Not a member yet? Register   Sign In
Quickest way to create CI application to manage existing MySQL database, enforcing database integrity.
#1

[eluser]avic[/eluser]
[I just realized that I posted this to the wrong forum, how do I delete the original post???]

Hi All,

I have less than two days to build a small app that will manage an existing MySQL database (about two dozen tables, all related either via one-to-many or many-to-many)

By manage I mean not just the std CRUD stuff, but also enforcing database referential integrity, and entity integrity.

Since the users have no knowledge of the database schema and relationships, the app will have to enforce the database referential integrity, i.e. not to allow a deletion of a record which is related by another record, or when creating a new entry, allow a selection of related records via a pull down (or an in-line creation of a new related record, i.e. if the desired value is not in the pull-down, allow simultaneous creation of both records, and if that new related record needs to relate to yet a third table… ) so that the new records will always relate to valid records, etc.

Similarly for entity integrity, since some columns can only contain specific data values, defined as SQL enum data type, I do not want to give user a plain text entry field. For these I would like the PHP code to pull the values from the table structure enum values. (so that I do not have to maintain the PHP code when a new data value is added to the SQL enum)

I do know PHP and SQL fairly well, and designed the database schema and a separate SQL query/reporting web application (done in a Java based wiki, which very limited in its database ability, I can only do SQL queries, no scripting at all, so I am not even able to do data validation, not to mention enforcing referential integrity)

Until now I just used phpMyAdmin to manage/maintain the database, but by Tuesday, I have to create a “user friendly” interface to manage the database.

I am a brand new CI user, just downloaded and installed it a few minutes ago so I pretty much know nothing about it, I’ve seen some of the CRUD examples, but none seem to enforce db integrity.

Is there a way to automagically generate PHP code from the existing database schema to speed up development?

i.e. classes/functions/methods for the database tables, code for CRUD forms (i.e. given a two or more related database tables, automagically create an HTML form for all the columns, pulling data from the database to populate pull-downs, related records, etc)

Does CI have any facility to enforce database integrity?

thank you so much

-avi


Messages In This Thread
Quickest way to create CI application to manage existing MySQL database, enforcing database integrity. - by El Forum - 01-08-2010, 08:53 PM



Theme © iAndrew 2016 - Forum software by © MyBB