I'm not a mysql expert so excuse the simplicity of my question. I have a table that is like that :
ID - NODE - ORIGIN - VALUE - DATETIME
1 - 11 - P1 - 2031 - 2017-01-01 20:15:17
2 - 11 - P2 - 2531 - 2017-01-01 20:15:17
3 - 11 - P3 - 2731 - 2017-01-01 20:15:17
4 - 11 - P4 - 2031 - 2017-01-01 20:15:17
5 - 11 - P1 - 2831 - 2017-01-01 20:30:17
6 - 11 - P2 - 2917 - 2017-01-01 20:30:17
7 - 11 - P3 - 2631 - 2017-01-01 20:30:17
8 - 11 - P4 - 2031 - 2017-01-01 20:30:17
And I'm request look like this:
SELECT *
FROM data
WHERE NODE = '$nodeid'
AND ORIGIN = 'P1'
AND DATETIME BETWEEN '$start' and '$end'
ORDER BY DATETIME
LIMIT 1000
And I receive a table with all result between $start
and $end
that have the origin P1
The problem is that I'm trying to draw a HTML table that will look like this
Date /time - P1 - P2 - P3 - P4
2017-01-01 20:15:17 - 2031 - 2531 - 2731 2031
2017-01-01 20:30:17 - 2831 - 2917 - 2631 2031
I dont know if I'm clear enough, but I dont even know if what I want is possible. Any help will be appreciated