Gossamer Forum
Home : Products : DBMan SQL : Discussion :

How come $rec{'Date'} doesn;t work?

Quote Reply
How come $rec{'Date'} doesn;t work?
How come $rec{'Date'} doesn work for sql version?

in cfg file it shows: create_date
in html.pl shows $rec{'Date'}
The above is just doesn;t work.

Then when I tried to make the syncronize I did:
in cfg file: create_date
in html.pl: $rec{'create_date'}

also no luck.

Anyone have any idea?

Wow, too many questions since I upgraded to mySQL version, this doesn't work, that doesn't work. :(

Thank you, anyone using mysql version? could you post your site link here?

__________________________
SantanaBlank
Quote Reply
Re: How come $rec{'Date'} doesn;t work? In reply to
In Reply To:
Then when I tried to make the syncronize I did:
in cfg file: create_date
in html.pl: $rec{'create_date'}
For whatever field you have defined as a DATE type field use the text string 'now' in your cfg file for a default value. Then whenever you enter a record, the date for that record will default to the current date in mysql format which is YYYY-MM-DD.


easy does it
Quote Reply
Re: How come $rec{'Date'} doesn;t work? In reply to
Hello,

Finally it works, in db.cgi it says :
In Reply To:
sub get_defaults {
# --------------------------------------------------------
# Returns a hash of the defaults used for a new record.

my (%default, $field);

foreach $field (keys %db_defaults) {
if (($db_defaults{$field} eq "now") and ($db_def{$field}[1] eq "DATE")) {
$default{$field} = &get_date;
}
elsif (($db_defaults{$field} eq "now") and ($db_def{$field}[1] eq "TIME")) {
$default{$field} = &get_time;
}
else {
$default{$field} = $db_defaults{$field};
}
}
return %default;
}
I think it is case sensitif.

Thanks for the advise.
__________________________
SantanaBlank