On 6/4/07, cake_learner <[EMAIL PROTECTED]> wrote:
>
>
> [..snip..]
>
> I want the data to be inserted into database with comma inbetween so,
> in the controller i have written the code,
>
>
> $langArr=$this->data['Client']['languages'];
> $imp=implode(',',$langArr);
> echo $imp;
>
>
> output:
> ,English, French
I believe that's because there is a hidden field set to blank as the first
value (mainly so that if nothing is selected, the "languages" key will still
be part of the POST data). You probably want to do something like:
unset( $this->data['Client']['languages'][0] );
As this value will always be blank. That should fix up your extra comma
problem.
Regards,
Gonzalo
1 There is a coma before the word English.
>
> Is there any wrong in the implentation? Please let me know.
>
> Thanks
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---