Anyone, help me here. Is my code possible? I need to assign the total number of records from the database query to the graph of javascript.
]<?php
mysql_connect("localhost", "aaaa", "aaa") or die(mysql_error());
mysql_select_db("aaa") or die(mysql_error());
$result = mysql_query("SELECT * FROM table WHERE field ='1'") or die(mysql_error());
while($row = mysql_fetch_array($result))
{
$id = $row['empId'];
}
?>
<SCRIPT LANGUAGE="JavaScript1.2" SRC="graph.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript1.2">
var g = new Graph(400,200);
g.scale = 1;
<?php
$resultCount = mysql_query("SELECT COUNT(*) FROM aa where bbb='1' AND ccc = '%egasg%'") or die(mysql_error());
$count= mysql_result($resultCount,0,0);
echo g.addRow($count,3,4,1);
?>
g.title = "haha";
g.xLabel = "adhsashd";
g.yLabel = "hasha";
g.build();
</SCRIPT>