title: 24 hours of values
body: <p>I have a sql table : date (Y-m-d) / time (00:00:00) / power (INT)</p>
  
  <p>When I select a date from an inline datepicker, I am trying to post 3 HighCharts graph (one-24 hours, two-31 days of month, three-12 months of year) and I need to get the values out of the table for the chart to be created.</p>
  
  <p>For the day, I need the 24 values for each hour '100,200,300,200,300 etc..'</p>
  
  <p>Here is the PHP for the "day" but it is not working...</p>
  
  <pre><code>&lt;?php
  $choice = (isset($_POST['choice'])) 
            ? date("Y-m-d",strtotime($_POST['choice'])) 
            : date("Y-m-d"); 
  $con = mysql_connect("localhost","root","xxxxxx");  
  if (!$con)  {  
    die('Could not connect: ' . mysql_error());  
  }  
  mysql_select_db("inverters", $con);  
  $sql = "SELECT HOUR(time), COUNT(power) 
  FROM feed 
  WHERE time = DATE_SUB('".$choice."', INTERVAL 24 HOUR) 
  GROUP BY HOUR(time) 
  ORDER BY HOUR(time)"; 
  $res = mysql_query($sql) or die('sql='.$sql."\n".mysql_error()); 
  $row = mysql_fetch_assoc($res); 
  echo $row['choice'].'&lt;br /&gt;'; 
  ?&gt;
  </code></pre>
  
  <p>This has been confirmed by another individual that the code does not work, would anyone have a helpful solution to fix the error ?</p>
  
  <p>Alan</p>