I am trying to send the result of the query, but not how. I need to plot
the total number of employees by gender. Initially I have total men. As I
can make this graph a pie chart with Google Charts? I could help?
<html>
<head>
<title>Salario Aproximado</title>
</head>
<body>
<?php
$conexion=mysql_connect(" "," "," ") or
die("Problemas en la conexion");
mysql_select_db(" ",$conexion) or
die("Problemas en la selección de la base de datos");
$query="SELECT COUNT( * ) AS HOMBRES FROM empleado WHERE sex_emp =
'HOMBRE'";
$resultado=mysql_query($query);
if ( !$result ) {
// Nope
$message = 'Invalid query: ' . mysql_error() . "\n";
$message .= 'Whole query: ' . $query;
die( $message );
}
$table = array(
'cols' => array(
array('label' => 'HOMBRES', 'type => 'string')
array('label' => 'sex_emp', 'type => 'number')
),
'rows' => array()
);
while ($row = mysql_fetch_assoc($result)) {
$table['rows'][] = array(
'c' => array(
array('v' => $row['HOMBRES']),
array('v' => $row['sex_emp'])
)
)
}
echo json_encode($table, JSON_NUMERIC_CHECK);
mysql_close($conexion);
?>
</body>
</html>
--
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.