Simple From Generator accessing MySql

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

    #1

    Simple From Generator accessing MySql

    I am sure this has been answered in over whelming detail in this group,
    however the search results have not turned up any thing I am interested
    in.

    I want a simple form generator in PHP that accesses a Mysql database.

    The program should (ideally in my opin):

    Generate a form when given a database name and table.
    Options for display only, insert new record, and edit.

    This is for internal company use only. So it does not have to look
    terribly pretty.

    Most of the form generators I have found require a considerable amount
    of coding to display a form nearly equal to what writing a form from
    scratch would require.

    I am looking for something like:

    include('form_l ine_generator.p hp');

    $db_name="my_da tabase";
    $table_name="cu stomers";

    $new_form= new form_line_gener ator();

    $new_form->get_connection ();
    $new_form->set_database_n ame($db_name);
    $new_form->select_db();
    $new_form->set_table_name ($table_name);
    $new_form->run_columns_qu ery(); // get the db columns names
    from db
    $new_form->generate_new_i nsert_form('not edit');

    I started writing my own, but I am out of time!

  • NSpam

    #2
    Re: Simple From Generator accessing MySql

    Bob wrote:[color=blue]
    > I am sure this has been answered in over whelming detail in this group,
    > however the search results have not turned up any thing I am interested
    > in.
    >
    > I want a simple form generator in PHP that accesses a Mysql database.
    >[/color]
    Cut for Brevity[color=blue]
    >[/color]

    Try a Google for PHPClasses - there may or not be a be a space there

    Hundreds of tools for forms and browsing


    Have fun

    Chris

    Comment

    • Geoffrey

      #3
      Re: Simple From Generator accessing MySql

      Bob wrote:[color=blue]
      > I am sure this has been answered in over whelming detail in this group,
      > however the search results have not turned up any thing I am interested
      > in.
      >
      > I want a simple form generator in PHP that accesses a Mysql database.
      >
      > The program should (ideally in my opin):
      >
      > Generate a form when given a database name and table.
      > Options for display only, insert new record, and edit.
      >
      > This is for internal company use only. So it does not have to look
      > terribly pretty.
      >
      > Most of the form generators I have found require a considerable amount
      > of coding to display a form nearly equal to what writing a form from
      > scratch would require.[/color]

      Although I haven't used it myself, you might want to check out the PEAR package DB_Table :



      It can generate PEAR HTML_QuickForm forms from your tables.

      Another PEAR alternative is DB_DataObject_F ormbuilder.

      Comment

      • Kenneth Downs

        #4
        Re: Simple From Generator accessing MySql

        Bob wrote:
        [color=blue]
        > I am sure this has been answered in over whelming detail in this group,
        > however the search results have not turned up any thing I am interested
        > in.
        >
        > I want a simple form generator in PHP that accesses a Mysql database.
        >
        > The program should (ideally in my opin):
        >
        > Generate a form when given a database name and table.
        > Options for display only, insert new record, and edit.
        >
        > This is for internal company use only. So it does not have to look
        > terribly pretty.[/color]

        We may have what you want. We have a complete system generator that takes a
        specification and builds a database and the web site to allow for
        maintenance. Security and automation are built in from the ground up.

        In many cases there is no programming. Here is a super-simple example of a
        time-zone table. We do not expect users to populate that table themselves,
        so we populate a table like that for them:

        --------------------------------------------
        --- BEGIN EXAMPLE SPECIFICATION ---
        --------------------------------------------
        TABLE,timezones ,Time Zones,timezone, reference,risim ple
        COLINTAB,timezo nes,timezone,Ti me Zone,char,7,0,p rimary_key;uise arch
        TABXCOLS,timezo nes,uisearch,_d esc
        TABXCOLS,timezo nes,uisearch,ui sort
        COLINTAB,timezo nes,timezone_ho urs,Offset Hours,int,0,0,u isearch
        COLINTAB,timezo nes,timezone_mi ns,Offset Minutes,int,0,0 ,uisearch
        COLINTAB,timezo nes,timezone_of f,Computed Offset,
        int,0,0,uisearc h,
        EXTEND,(@timezo ne_hours * 60) + @timezone_mins
        (above 3 lines are actually one line)
        PROJECT,timezon es,dropdown,tim ezone_desc

        CONTENT,timezon es,I,timezone;t imezone_hours;t imezone_mins;ti mezone_desc,uis ort
        NZDT,13,00,New Zealand Daylight-Saving Time,170
        IDLE,12,00,Inte rnational Date Line, East,180
        NZST,12,00,New Zealand Standard Time,190
        NZT,12,00,New Zealand Time,200
        .....
        .....many more lines here :)
        --------------------------------------------
        ---- END EXAMPLE SPECIFICATION
        --------------------------------------------

        Note the line beginning with "PROJECT", this names a projection, or named
        list of columns. Whenever table timezones is used as a foreign key in
        another table, the UI looks for the "dropdown" projection and if it finds
        it it uses it to define a <SELECT> element for that column.

        The column "uisort" is used to sort things whose natural order makes no
        sense to people. So in a table of timezones you may want to force
        "EST5EDT" to the top by giving it a vaue of zero in that table.
        [color=blue]
        >
        > Most of the form generators I have found require a considerable amount
        > of coding to display a form nearly equal to what writing a form from
        > scratch would require.
        >
        > I am looking for something like:
        >
        > include('form_l ine_generator.p hp');
        >
        > $db_name="my_da tabase";
        > $table_name="cu stomers";
        >
        > $new_form= new form_line_gener ator();[/color]

        Actually ours does not require any of this. We build systems entirely based
        upon database operations, and so we assume that all of this is routine and
        nobody wants to be bothered with it. You type the spec in notepad (or vim)
        and feed it to the generator. Then you log in and start doing your
        inserts, updates, and so forth.
        [color=blue]
        >
        > I started writing my own, but I am out of time![/color]

        Now for the gotchas. The system builds PostgreSQL databases, not MySQL, and
        we have no plans to target MySQL until they significantly upgrade its
        abilities in the areas of triggers and query complexity.

        Second is that the system, while it is very easy for us to use, has had no
        effort made to make it usuable by anybody but those of us who created it
        and use it. It may take some effort to get you up to speed, but you won't
        have to worry about coding.

        Finally, we believe it can only benefit us to have the system in use as
        widely as possible, and so are happy to make easy terms (read: free) with
        fellow developers who may wish to climb on board as early adopters.

        --
        Kenneth Downs
        Secure Data Software, Inc.
        (Ken)nneth@(Sec )ure(Dat)a(.com )

        Comment

        Working...