0

I am working on a database in mysql and I need to make a user facing page that allows me to enter text for each field and then submit the record. I have been able to accomplish this easily, however it is getting quit annoying having to update the input.html and save.php every time I decide to add/remove a field.

It really seems like there should be some sort of program that can auto-maintain the code for me and allow me to just focus on the database structure. Does anyone know of something that does this? I feel like I am doing it all wrong.

Thanks in advance.

P.S. I realize that I could just use phpmyadmin, but I do not want to give full DB access to my data entry people; plus they are not technical types, I don't want to intimidate them.

Weston
  • 1,481
  • 1
  • 11
  • 31
  • You'd probably want a db framework for this, but we're not a recommendation engine - you'll have to dig up one yourself. – Marc B Jun 27 '12 at 11:33
  • 1
    Have u tried some frameworks (Symfony2, Zend, Yii, etc). One of their tasks is to handle such a moments. – Ziumin Jun 27 '12 at 11:35
  • i agree with @MarcB would look at database abstraction layer. If i recall when i was doing similar things years ago i used to use pear db http://pear.php.net/package/DB/docs sorry id like to ammend my comment and say it was db_dataobject http://pear.php.net/manual/en/package.database.db-dataobject.php that did the table abstraction, although im not sure if this is still a good way to go. – Nicholas King Jun 27 '12 at 11:36
  • 1
    @MarcB Lol? I thought we were a community where people could ask questions and advice. Recommending things is part of what we do to help... – Rick Kuipers Jun 27 '12 at 11:36
  • I found this http://stackoverflow.com/questions/108699/good-php-orm-library similar question. I believe ORM is the key term here. – Jake Jun 27 '12 at 11:40
  • 2
    CakePHP framework has a nice tool for this - You only create a DB tables and call that tool pointing to Your DB. It will automatically construct basic CRUD (Create-Update-Delete) application in MVC (Model-View-Controller) architecture (yes, it creates the PHP controller and model classes and HTML views)... – shadyyx Jun 27 '12 at 12:41

1 Answers1

0

In the end, I decided to make my own script, using INFORMATION_SCHEMA to get the field names, and then made a recursive loop to add each record. It wasn't hard, but it seems like there should still be a better way.

Weston
  • 1,481
  • 1
  • 11
  • 31