[phorm] [Phorm:] Re: Write correct array to database?

  • From: webbbs@xxxxxxxxx
  • To: support@xxxxxxxxx
  • Date: 27 Aug 2004 18:30:18 -0000

The following new message has been posted on Phorm Support Forum at 
<http://www.phorm.com/support/>. 

*************************************************************************** 

  MESSAGE:  (#4303) Re: Write correct array to database? 
            <http://www.phorm.com/support/?rev=4303> 
  AUTHOR:   Holotech 
  DATE:     August 27, 2004 at 2:30 p.m. EST 

  Reply To: (#4292) Write correct array to database? 
  Author:   Steve 
  Date:     August 25, 2004 at 12:12 p.m. EST 

> In my config I have: 

> $interest[1] = "Kayaking"; 
> $interest[2] = "Traveling"; 
> $interest[3] = "Wildlife"; 

> And when I use ArrayToList($interest); I get the 
> following written to my database: 
> 3, Kayaking, Traveling, and Wildlife 

> Where the "3" is the item that is checked. 
> What do I need to change to have it just write the 
> checked items value? Not the number, and all 
> descriptions. 

You didn't provide details about the form fields, but from your description 
I'd guess you have something like: 

<INPUT TYPE=CHECKBOX NAME="interest[]" VALUE=1> 

etc. 

So, this is passed to PHP as an array, and then in your config you append the 
elements [1], [2] and [3], with their values. This is what you're getting in 
your database. 

If what you want in the database is the descriptions, why not do this: 

<INPUT TYPE=CHECKBOX NAME="interest[]" VALUE="Kayaking"> 

and then use ArrayToList on $interest. 

*************************************************************************** 

This is an automatically-generated notice.  If you'd like to be removed from 
the mailing list, please visit Phorm Support Forum at 
<http://www.phorm.com/support/>, or send your request to webbbs@xxxxxxxxxx  If 
you wish to respond to this message, please post your response directly to the 
board.  Thank you! 
-------------------------------------------------
You are receiving this message because you are subscribed to the Phorm mailing 
list. To send messages to the mailing list, simply send email to 
phorm@xxxxxxxxxxxxx from the address you have subscribed. You may unsubscribe 
from the list by sending email to phorm-request@xxxxxxxxxxxxx with 
'unsubscribe' in the SUBJECT field.

Other related posts:

  • » [phorm] [Phorm:] Re: Write correct array to database?