I edit the question:
I am using HighCharts
within WordPress to display data from a DB MySql
.
I want to display data between a date range selected by the user
In the code of HighCharts
, in the data section I do not have static data but dynamic data invoked from the WordPress DB . What I want to achieve is that the sql parameter BETWEEN '2017-05-28' AND '2017-06-01' takes the range of dates that the user selects in the input and not these static dates.
I don't know if that makes my concern clearer!
I imagine you want to pass dates in highcharts and update your chart. if this is the example here:
http://jsfiddle.net/5dszcfq7/1/ if you want to refresh in wordpres through your code it is the following (I have not tried it, I only did it for logic):
Well, @JackNavaRow's answer helped me to clarify my doubt.
The solution is in the following code block:
The first part is an Html5 form that sends the dates selected by the user to php through the post method. In the second part, the dates are captured with the php variables $fechaini and $fechafin
Finally, these variables are used in the SQL statement BETWEEN '$fechaini' AND '$fechafin'
if what you want to do is that when the user changes the date your chart is updated. What you should do is have 2 pages: The first with the date range that the user is going to manipulate, and the second embedded in the first and receiving the date variables, so that when the user changes the ranges you do a REFRESH to the page containing the Highchart script. This was what I did for a project a long time ago.
I hope it helps you, greetings.