Re: Dates in QuickForm
| From: | php-gen | Date: | Mon, 01 Sep 2003 03:07:38 +0000 |
| Subject: | Re: Dates in QuickForm | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-7520@lists.php.net to get a copy of this message | ||
I've worked out that I can get it working using:
$sql = "select user_id, user_name, email_address, password, user_level,
dayofmonth(expiry_date) as d, month(expiry_date) as M, year(expiry_date) as
Y from users where user_id = '$id'";
..
$user = $result->fetchRow(DB_FETCHMODE_ASSOC);
...
$dates['expiry_date'] = array('d'=>$user['d'],
'M'=>$user['M'],
'Y'=>$user['Y']);
$defaults = array_merge($dates, $user);
$form->setDefaults($defaults);
....
This isn't very elegant. Is there another way?
Leonie