How do I save a concat'ed text to db?

fribse 07 Dec, 2011
Ok, starting over on my little simple form, and still no clue as to why I can't get my variable stored in the database.

I have created a form with a series of fields.

One of them is 'year-week day', and I've given instructions that it should have a format of '11-49 Ons'.
I would like to control the formatting a bit closer thus split it to three fields:
year (number with two digits)
week (number with two digits)
day (selext box).
Then concat the three fields to one, and store the concat'ed value in the db.
I've created a hidden field (ugedagtekst) for the concat'ed value, as I suspect that is necessary to accomplish this.

So, with much help from Bob, I've created the small piece of code:
<?php
   $year = JRequest::getVar('year', 0, 'post');
   $week = JRequest::getVar('week', 0, 'post');
   $day = JRequest::getVar('day', 0, 'post');
   $ugedagtekst = $year. '-' .$week. ' ' .$day;
   echo 'UgedagTekst:"'.$ugedagtekst.'"';
   $from->data['ugedagtekst'] = $ugedagtekst ;
?>


The variable ugedagtekst is created correctly, but I don't see anything stored in the database this way (either).
fribse 07 Dec, 2011
SOLVED - Finally found the problem.

The previous code-advice said 'From' and not 'Form'!

So changing that made it save it, weehee
GreyHead 07 Dec, 2011
Hi fribse,

Apologies for my typo - spell-check doesn't catch that one :-(

Bob
fribse 07 Dec, 2011
He he, and sadly the word 'from' also made sense in the context :-)
This topic is locked and no more replies can be posted.