I can't really help, but mysql_fetch_assoc($sth3)) in your code is looking 
for a boolean (TRUE or FALSE) value. Need to find out why the difference.

On Sunday, September 28, 2014 6:35:08 AM UTC+13, Stefan Steuer wrote:
>
> Hi guys,
> I tried to create a column chart with the following code
>
> <? $sth3 = mysql_query("SELECT count(t.tn) AS Tickets, q.name AS Queue 
> FROM ticket t, queue q WHERE t.queue_id=q.id AND t.ticket_state_id IN 
> (1,4,6,7,8) GROUP BY q.name");
> $rows = array();
> //flag is not needed
> $flag = true;
> $table = array();
> $table['cols'] = array(
>     array('label' => 'Queue', 'type' => 'string'),
>     array('label' => 'Tickets', 'type' => 'number')
> );
> $rows = array();
> while($r = mysql_fetch_assoc($sth3)) {
>     $temp = array();
>     $temp[] = array('v' => (string) $r['Queue']); 
>     $temp[] = array('v' => (int) $r['Tickets']); 
>     $rows[] = array('c' => $temp);
> }
> $table['rows'] = $rows;
> $jsonTable3 = json_encode($table); ?>
>
>
> ..........
>
>
> function drawChart3() {
>
>       // Create our data table out of JSON data loaded from server.
>       var data = new 
> google.visualization.arraytoDataTable(<?=$jsonTable3?>);
>       var options = {
> title: 'Company Performance',
> hAxis: {title: 'Year', titleTextStyle: {color: 'black'}},
> width: 1000,
>           height: 600,
> };
>
> var chart = new 
> google.visualization.ColumnChart(document.getElementById('chart_div3'));
>
> chart.draw(data, options);
>
> }
>
>
>
> .......
>
>
> But I'll get every time 
> *Warning*: mysql_fetch_assoc() expects parameter 1 to be resource, 
> boolean ... 
>
> This codes works fine with the pie chart :( Any idea?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.

Reply via email to