如何过滤图表视图中显示的sarch结果 [英] How do I filter sarch results presented in chart view

查看:51
本文介绍了如何过滤图表视图中显示的sarch结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在搜索结果使用此方法后在图表中显示结果,



i有一个php文件,结果显示我搜索数据库但我需要在没有此代码的情况下显示图表中的结果

<?php 

$ dbhandle = new mysqli('localhost','root','','dbtest');
echo $ dbhandle-> connect_error;


$ query =SELECT sex,sum(sn)FROM person group by sex;
$ res = $ dbhandle-> query($ query);

?>

并使用gstatic / loader.js图表​​显示但我想根据我的搜索结果



我尝试过:



<?php 
include(connect /db.php);

if(isset($ _ GET ['id'])){
$ page_id = $ _GET ['id'];
$ dbhandle = new mysqli('localhost','root','','dbtest');
echo $ dbhandle-> connect_error;


$ query =SELECT sex,sum(sn)FROM person group by sex where id ='$ page_id';
$ res = $ dbhandle-> query($ query);

}
?>


i希望搜索php文件的结果显示在此页面上,其中图表应显示

请帮助

解决方案

dbhandle = new mysqli('localhost','root','','dbtest');
echo


dbhandle-> connect_error;


query =SELECT sex,sum(sn)FROM person group by sex;

how can i show results in chart after search results am using this method,

i have a php file where results show after i search the database but i need to show the results in chart without the this code

<?php 

$dbhandle = new mysqli('localhost','root','','dbtest');
echo $dbhandle->connect_error;


$query = "SELECT sex, sum(sn) FROM person group by sex ";
$res = $dbhandle->query($query);

?>

and using the gstatic/loader.js the chart is showing but i want results based on my search

What I have tried:

<?php 
include("connect/db.php");  

 if(isset($_GET['id'])){
      $page_id = $_GET['id'];
$dbhandle = new mysqli('localhost','root','','dbtest');
echo $dbhandle->connect_error;


$query = "SELECT sex, sum(sn) FROM person group by sex where id='$page_id' ";
$res = $dbhandle->query($query);

 }
?>


i want the results from the search php file to be displayed on this page where the chart should show 

please help

解决方案

dbhandle = new mysqli('localhost','root','','dbtest'); echo


dbhandle->connect_error;


query = "SELECT sex, sum(sn) FROM person group by sex ";


这篇关于如何过滤图表视图中显示的sarch结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆