Re: Dynamically generating PHP functions?
| From: | David Newcomb | Date: | Fri, 15 Sep 2000 09:06:31 +0000 |
| Subject: | Re: Dynamically generating PHP functions? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-16903@lists.php.net to get a copy of this message | ||
> I have written a script
What sort of script: php script or shell script?
> that dynamically generates a form from a given
> database and table that would be suitable, as a generic data input
> device for any mysql table.
Take a look at phpMyAdmin it dose the same thing!
> My problem is that when I have tried to write the script for the forms
> action i.e.:
>
> ...
> mysql("database","INSERT INTO table Values (
> '$field1',
> '$field2',
> '$field3',
> '$field4'
> )");
>
>
> I cannot figure out how to generate the above function dynamically so
> that that it has the correct number of fields for the given database
> table, does anyone know how one would go about writing php functions
> dynamically then executing them?
create_function() is for you,
hth,
David.