Page 1 of 1

PHP: select from

Posted: Sunday 08 April 2018 16:39
by ropske
Hi, i have a question about my SELECT from query, now it is:

Code: Select all

$stmt = $mysqli->prepare("SELECT vaatwas, wasmachine, droogkast, aquarium, timestamp FROM Verbruik_Toestellen WHERE timestamp >= SYSDATE() - INTERVAL 1 DAY");
i also have a date picker in my website:

Code: Select all

<font size=2 face='Verdana'>Enter your date</font><input type=text name='p_name' size='8'> <a href="javascript:void(0);" NAME="plus2net Calendar" title=" plus2net Calendar " onClick=window.open("cal2.php","Ratting","width=350,height=270,left=150,top=200,toolbar=1,status=1,");>Click here to open the calendar window</a>
i would love to have that the query is changed with the data that has been chosen from the date picker

Anyone that can help me or guide me in the right direction?
Thank you.

Re: PHP: select from

Posted: Thursday 19 April 2018 8:32
by Egregius
Any luck on this yet?
I don't use datepickers. If you have a input type="date" Chrome and iOS devices show a calendar.

Re: PHP: select from

Posted: Thursday 19 April 2018 22:10
by ropske
hi mate,

nah, still not working :(


what i would love to have is that i can select a date where it loads the query from that date

Re: PHP: select from

Posted: Friday 27 April 2018 9:03
by Egregius
You could take a look at https://github.com/Egregius/PHP-Custom- ... r/temp.php to see how I do it.
That page provides 2 date fields creating a from/to query.