data['startdate']; $enddate=$form->data['enddate']; echo "Paypal Report: $startdate thru $enddate"; $db = JFactory::getDBO(); $query = $db->getQuery(true); ?>Still pulling all dates. Appreciate any guidance!"> db read data between two dates - Forums

Forums

db read data between two dates

mduda 15 Aug, 2016
Hi Bob,

I have a cf that I've added two date pickers on the show html (named "startdate" and "enddate"):
[attachment=0]cf_datepicker.png[/attachment]

DB Read pulls the data which comes from several tables.

Now I'm trying to get the dates to actually pull properly. I have conditions in the db read as follows:
<?php
return array( 'p.order_product_code' => array( 'Student_Membership', 'Adult_Yearly_Membership', 'Adult_Membership_9', 'Staff_Membership_7', 'Staff_Membership_10'));  
     $startdate=$form->data['startdate'];
     $enddate=$form->data['enddate'];
     echo "Paypal Report: $startdate thru $enddate";
     $db = JFactory::getDBO();
     $query = $db->getQuery(true);  
?>


Still pulling all dates. Appreciate any guidance!
GreyHead 15 Aug, 2016
Hi Mduda,

A good PHP Tutorial would be a useful next step, pretty much everything is wrong with your example.:-(

+ The code line needs to return an array - which you have in the first line

+ The next three lines don't do anything as far as I can see - they might output a string or perhaps an error message

+ The last two lines probably get the last database query but do nothing with it - and you don't need it anyhow.

Bob
mduda 15 Aug, 2016
Agreed! Definitely need to work on php skills!😟 Thanks Bob. I'll keep working on it.
This topic is locked and no more replies can be posted.