In your example, I would name my form inputs similar to name

Then you just pass the $_POST['data'] array to your function.


Allen McCabe wrote:
> You raise some good points. I always name my input fields after the
> entity names ( eg. input type="hidden" name ="user_id" value=" ?php
> echo $resultRow['user_id'] ? " ).
> I suppose I am still in the phase of learning efficiency, and perhaps
> trying to 'get out it' by writing functions that I can just call and
> pass parameters instead of fully learning the core concepts.
> I just think functions are so damn cool :)
>     I'll echo what the others have said about the parameters.  For me
>     personally, if I am passing more than three parameters (sometimes even
>     three) I rethink my function.  I'm not sure what you envision
>     using this
>     function for, but the approach I use for forms and databases is always
>     arrays.  I get an array from my forms, I insert that array into the
>     database, and of course I fetch arrays out of the database.  These are
>     all indexed the same with the index as the field name of the table so
>     it's easy.
>     --
>     Thanks!
>     -Shawn

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to