PHP, MySQL. Min and max value day, month and year
<p>Edit for clarification:</p>

<p>This is my table:</p>

<pre><code>ID      Datetime            Date        Temp
6043    2016-05-24 10:20:00 2016-05-24  19.3
6042    2016-05-24 10:15:00 2016-05-24  19.1
6041    2016-05-24 10:10:00 2016-05-24  19.1
6040    2016-05-24 10:05:00 2016-05-24  19.1
</code></pre>

<p>What I'm trying to do is to select the row with the highest "Temp". </p>

<p>This is my query:</p>

<pre><code>SELECT max(temp) as maxtemp FROM weatherdata WHERE day(date) = 24
</code></pre>

<p>The query only gives me the maxtemp, how can I get the ID and Datetime?</p>

<p>Goal is to get the max-value for each day in my table (WHERE day(date) = xx) </p>

<p>Kind Regards</p>