PHP: select from

Moderator: leecollings

Post Reply
ropske
Posts: 483
Joined: Tuesday 12 August 2014 5:37
Target OS: Raspberry Pi / ODroid
Domoticz version: V3_8394
Location: Rumbeke,Belgium
Contact:

PHP: select from

Post 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.
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: PHP: select from

Post 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.
ropske
Posts: 483
Joined: Tuesday 12 August 2014 5:37
Target OS: Raspberry Pi / ODroid
Domoticz version: V3_8394
Location: Rumbeke,Belgium
Contact:

Re: PHP: select from

Post 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
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: PHP: select from

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest