473,506 Members | 17,266 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to retrieve data from mysql database to plot jquery flot graph

31 New Member
Hello all
I am trying to retrieve the data from mysql database by php to plot a flot graph can anyone help me please this is all i have done for now
Php

Expand|Select|Wrap|Line Numbers
  1. $sql = mysql_query("SELECT count(Msg_ID) msgCount,Group_ID 
  2.                                       FROM Messages 
  3.                                         GROUP BY Group_ID");
  4.  
  5. $dataset1 = array();
  6.  
  7.  
  8.     while ($row = mysql_fetch_assoc($sql)) 
  9.     {
  10.         $dataset1[] = array( $row['msgCount'], $row['Group_ID'] );
  11.     }
  12.  print_r($dataset1);
  13.  
  14. jquery
  15.     function plotGraph()
  16.     {
  17.         alert("In body");
  18.         $.ajax({
  19.             url:"getData.php",
  20.             type:"post",
  21.             datatype:"json",
  22.             success:function(data)
  23.             {
  24.             $.plot($("#placeholder"), [ data ]);
  25.            },
  26.             error:function()
  27.             {alert("There was a problem");}
  28.         })
  29.     }
This draws the place holder but with no lines
Aug 25 '09 #1
2 12705
Markus
6,050 Recognized Expert Expert
What do you get if you alert(data) in your success function. What kind of data does the plot need?
Aug 25 '09 #2
sarah aziz
31 New Member
I am just testing by count of messages for each group, so i guess it is integer
is that what you are asking for
Aug 25 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
5656
by: ¶}¾Ç¤F¶Ü? | last post by:
I'm trying to write a script to pass a file of stock prices and volumes, and plot the results on a gnuplot graph which is non-overlapped graph. Fig. 1 ------------ Fig. 2 Figure 1 is a graph...
12
6521
by: Russ | last post by:
I'm interested in setting up a web page where live data can be displayed in real-time on the web page. For example: I would like to display a (nice looking) graph of some data value versus time...
12
13867
by: slowgirl | last post by:
i'm using vb to plot graph. i've already drawn the graphsheet using drawlines. and include labels. all i arrange according to pixels. the problem i face now is that i need to plot certain symbols...
1
1951
by: Matuag | last post by:
Hi, I want to plot a graph (Audiogram) for frequency (X axis) against intensity (Y axis). Data for which will be sourced from an existing table following frequency fields....
0
1566
by: jatininfo | last post by:
Hi.. I am working on a medical device which will give the various current reading of various types of parameter from patient body like oxygen lavel, breathing, tampature etc, and it's a...
5
5711
by: grant | last post by:
I'm trying to use a scatter chart to plot level reading for a pump station level sensor. The sensor takes a reading every 4 seconds, and there are 23,000 reading per chart There appears to be...
3
2494
by: fAnSKyer/C# newbie | last post by:
My problem is use what tool to plot a graph sound wave, which requires a high refresh rate. Or any other approach to solve this problem? Any suggestions Thanks a lot Cheers fAnKa
14
6164
by: zionlion | last post by:
I want to only retrieve the values of one column in mysql and use these values to plot a graph. I know how to echo these values. However, I am unable to write them seperately. Let's say I have a...
0
1798
by: mostafijur | last post by:
Hello I want to show continuous graph using Gnu plot. That means after 1 hour I want to see previous every 10 mins graph. Gnu Plot Version: 4.0, Linux kernel: 2.6, UBUNTU I can access Gnu...
0
7220
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7371
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7023
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7479
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5037
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3188
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1534
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
410
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.