Re: Dynamically generating PHP functions?
| From: | Aaron Sinclair | Date: | Fri, 15 Sep 2000 08:20:10 +0000 |
| Subject: | Re: Dynamically generating PHP functions? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-16958@lists.php.net to get a copy of this message | ||
can we have a look at the script / form that you are trying to accomplish
this from?
Not really sure of what you are trying to achieve, what about using
$fields = mysql_num_fields($result);
then pass $fields along to the form processing script.
--
Kind Regards
Aaron Sinclair
Webmaster, Regional Communications
Mercy Ships-Pacific
http://www.mercyships-pacific.org.nz
> From: Joseph H Blythe <joe.blythe@binarylogic.com.au>
> Organization: Binary Logic
> Date: Fri, 15 Sep 2000 15:01:04 +1030
> To: PHP-General <php-general@lists.php.net>
> Subject: [PHP] Dynamically generating PHP functions?
>
> Hey,
>
> I have written a 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.
>
> 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?
>
> I suppose it is much the same as the way php dynamically generates html,
> but I need it to do it on itself, if this makes any sense.
>
> Any help would be much appreciated.
>
> Joseph
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net