• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Date Calculation Using Database Fields

Date Calculation Using Database Fields 11 years 9 months ago #24231

Hello,

I need to do some date calculations in a form. The date plus the number of days for the calculation I am retrieving from my database. Right now I have this as my default value on my field:
//<code>
$db =& JFactory::getDBO(); 
$subid = JRequest::getVar('subid');
$query = "select next_fulfillment from hc_subscriptions where  sub_id = $subid";
 
$db->setQuery($query); 
$result = $db->loadResult();
$result = date($result,strtotime('+14 days'));
return $result;
 
//</code>


I am eventually going to get the number of days to calculate by from the database as well, but right now I am just trying to get the date calculation to work. Can someone help with the calculation? It should be the next_fulfillment date from the database plus the number of days in the strtotime calculation.

Thanks,

Josh
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!