php - mysql form field generator

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Michael Haas

    #1

    php - mysql form field generator

    Hi, does anyone know of a simple function/class that will take config
    options: table name and the database connection stuff(or whatever)
    It will then print out appropriate form fields to allow editing of a
    row?

    The reason being is that in the admin section of a website I am
    building we are constantly adding columns to a table...It is used for
    keeping config options of the site. We do not wanna update the form
    each time we add a column.

    Any good scripts out there for this?

    Thanks.
  • Pedro Graca

    #2
    Re: php - mysql form field generator

    Michael Haas wrote:[color=blue]
    > Hi, does anyone know of a simple function/class that will take config
    > options: table name and the database connection stuff(or whatever)
    > It will then print out appropriate form fields to allow editing of a
    > row?[/color]
    [color=blue]
    > Any good scripts out there for this?[/color]

    Don't know if there are.
    But it sound easy to do your own, using mysql_field_*() functions.
    --
    --= my mail box only accepts =--
    --= Content-Type: text/plain =--
    --= Size below 10001 bytes =--

    Comment

    • Robert Peake

      #3
      Re: php - mysql form field generator

      Michael Haas wrote:[color=blue]
      > Any good scripts out there for this?[/color]

      MySQLAdmin is not a library of functions or a class, but can be extended in
      a library-like way to create a web-based interface to your MySQL
      application.

      Cheers,
      Robert
      --
      Robert Peake | Peake Professional Consulting
      Robert@PeakePro .com | http://www.peakepro.com/

      Comment

      • Andy Harris

        #4
        Re: php - mysql form field generator

        lilmike@blueshi nedesign.com (Michael Haas) wrote in message news:<d849ba7.0 403140527.14d24 0b7@posting.goo gle.com>...[color=blue]
        > Hi, does anyone know of a simple function/class that will take config
        > options: table name and the database connection stuff(or whatever)
        > It will then print out appropriate form fields to allow editing of a
        > row?
        >[/color]

        It's reasonably easy to write a program that creates a text field for
        each field in a table, but such a program is dangerous, because it
        allows the user to directly edit foreign key references. (very bad)
        and primary key (very very bad) I've written a library that
        automatically creates such a form, and an improved version that
        automatically detects foreign and primary keys. The primary key field
        is not edited, and the foreign key references are replaced with
        drop-down lists, so the user doesn't have to fiddle directly with FKs.
        Unfortunately, MySQL doesn't (yet) have a way to introspect whether a
        current field is used as a foreign key reference. I got past this
        with naming conventions, although the library could still be used
        without my convention.

        You can see the library in action at

        http://shelob.cs.iupui.edu:18011/n342. Look for chapter 10.

        You're welcome to download the source and play with it yourself. If
        you want more information, <plug> I recommend my book PHP/MySQL for
        the Absolute Beginner. It contains a full explanation of the library,
        and how to configure it for your own purposes. </plug>

        -Andy Harris

        Comment

        Working...