Home >Backend Development >PHP Tutorial >php组合highcharts和Ajax获取数据失败
php结合highcharts和Ajax获取数据失败
效果图如上,但是我只完成了下面那个表格那块,上面的走势图弄不出来,我是分别Ajax来获取了(走势图和表格分开的);本来是想用一个文件来完成,但是失败了
下面放上文件:
主文件
<?php <br />require ('inc/config.php');<br>$page_title = '各区域住宅成交情况-feige数据中心';<br>include ('inc/header.php');<br>require (MYSQL);<br>?><br><div> <br> <div>各区域住宅成交情况</div> <br> <div> <br> <form> <br> <div> <br> 区域<br> <select><br> <?php <br /> $q = "SELECT city_id, city_name FROM f_city ORDER BY city_id ASC"; <br> $r = mysqli_query ($conn, $q) or trigger_error("Query: $q\n<br>MySQL Error: " . mysqli_error($conn));<br> if (@mysqli_num_rows($r) > 0) {<br> while ($row = mysqli_fetch_array ($r, MYSQLI_NUM)) {<br> echo "<option>$row[1]</option>\n";<br> }<br> mysqli_free_result ($r);<br> } else {<br> echo '<option>暂无区域,请添加一个新地区</option>';<br> }<br> mysqli_close($conn);<br> ?><br> </select> <br> 自定义时间范围<br> <input>至<input><br> <input><br> </div> <br> </form> <br> <br> <br><br> <div></div> <br> <table> <br> <thead> <br> <tr> <br> <th></th> <br> <th>成交面积</th> <br> <th>成交套数(套)</th> <br> </tr> <br> </thead> <br> <tbody> <br> <tr> <br> <td>2014-08-15</td> <br> <td>222</td> <br> <td>16670</td> <br> </tr> <br> <tr> <br> <td>2014-08-16</td> <br> <td>7167.07</td> <br> <td>621</td> <br> </tr> <br> <tr> <br> <td>2014-08-17</td> <br> <td>71660.07</td> <br> <td>62</td> <br> </tr> <br> <tr> <br> <td>2014-08-18</td> <br> <td>21</td> <br> <td>716</td> <br> </tr> <br> </tbody> <br> </table> <br><br><br> <div class="clear"> </div> </div> </div>