从反馈表单创建平均评级图表 [英] Create graph of average rating from a feedback form

查看:142
本文介绍了从反馈表单创建平均评级图表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我有一个用php编码的反馈表(1-5级评级系统),用mysql存储数据。现在我想创建一个平均评级的图表。



我不知道如何从php中获取数据作为mysql中的图形,以便显示平均值评级。



谢谢



这是我的php表格



Hi,

I have a feedback form(rating system from 1-5) coded in php which stores data in mysql. Now I want to create a graph of average ratings.

I have no idea of how to fetch data in a php as a graph from mysql so that it shows the average rating.

Thanks

This is my php form

<title>process</title>
 "") print mysql_error() . "";
mysql_select_db($database_name, $db);
if (mysql_error() > "") print mysql_error() . "";
$waiting = $_POST['radio1'];
$consultation = $_POST['radio2'];
$preoperative = $_POST['radio3'];
$specialists = $_POST['radio4'];
$assistants = $_POST['radio5'];
$painful = $_POST['radio6'];
$operatingroom = $_POST['radio7'];
$thought = $_POST['radio8'];
$recommend = $_POST['radio9'];
$suggestions = $_POST['suggestions'];
$query = "insert into feedback (waiting, consultation, preoperative, specialists, assistants, painful, operatingroom, thought, recommend, suggestions) values ('" . $waiting . "', '" . $consultation . "', '" . $preoperative . "', '" . $specialists . "', '" . $assistants . "', '" . $painful . "', '" . $operatingroom . "', '" . $thought . "', '" . $recommend . "', '" . $suggestions . "')";
if (mysql_error() > "") print mysql_error() . "";
$qresult = mysql_query($query);
echo "Thank you for submitting your details!";
?>

推荐答案

database_name,
database_name,


db);
if(mysql_error()>)print mysql_error()。 ;
db); if (mysql_error() > "") print mysql_error() . "";


waiting =
waiting =


这篇关于从反馈表单创建平均评级图表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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