Sites Using PHP
| From: | Jeff Wilhelm | Date: | Fri, 21 Jul 2000 00:02:40 +0000 |
| Subject: | Sites Using PHP | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-7497@lists.php.net to get a copy of this message | ||
http://www.visorcentral.com/
J E F F R E Y M . W I L H E L M
Phone: (860) 688-2976
Voice Mail: (860) 285-7779 x2811
Fax: (419) 735-8865
E-Mail: jeff@jjjweb.com
Internet: http://www.jjjweb.com
Read my Epinions at: http://www.epinions.com/user-jwilhelm
----- Original Message -----
From: "Ryan Adams" <radams@fcs.uga.edu>
To: "Martin A. Marques" <martin@math.unl.edu.ar>
Cc: <php-general@lists.php.net>
Sent: Thursday, July 20, 2000 12:50 PM
Subject: Re: [PHP] form question
> I've found that passing a field list is the safest way to get what
> you want. The fact that checkboxes are undefined rather than empty
> set if they're not checked kind of irks me - it disallows a lot of neat
> tricks with arrays and such... ah well...
>
> I like to use routines such as
>
> $a_fields = explode (", ", $fieldlist); // make array of field list
> while (list ($k, $v) = each ($a_fields)) {
> $h_fields[$v] = $$v; // if you put this in a function, globalize $$v
> }
>
> // insert query
> $fl = implode (", ", array_keys ($h_fields));
> $vl = "\"".implode ("\", \"", array_values
> ($h_fields))."\"";
> $q_insert = "insert into tablename ($fl) values ($vl)";
>
> // update query
> while (list ($k, $v) = each ($h_fields)) {
> $aul[] = "$k=\"$v\"";
> }
> $ul = implode (", ", $aul);
> $q_update = "update tablename set $ul";
>
> to manage the queries on the other end.
>
> Hope this helps,
> Ryan
>
>
> On Tue, Jul 18, 2000 at 03:42:24PM -0300, Martin A. Marques wrote:
> > I have a form that calls another php script, and I need to know which
> > variables the form passed to the new script to make a new query.
> >
> > Any idea?
> >
> > --
> > "And I'm happy, because you make me feel good, about me." - Melvin Udall
> > -----------------------------------------------------------------
> > Martín Marqués email: martin@math.unl.edu.ar
> > Santa Fe - Argentina http://math.unl.edu.ar/~martin/
> > Administrador de sistemas en math.unl.edu.ar
> > -----------------------------------------------------------------
> >
> > --
> > 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
> ---end quoted text---
>
> --
> 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
>
>