Hi,
I need some help on some simple java. Basically what I would like to do is to run a SQL script and then the results from that script to be passed into Java.
The code I currently have is:
Can any one give me some guidance on where this is going wrong?
Andy
I need some help on some simple java. Basically what I would like to do is to run a SQL script and then the results from that script to be passed into Java.
The code I currently have is:
Code:
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>
<body>
<script type="text/javascript" src="wz_jsgraphics.js"></script>
<script type="text/javascript" src="pie.js">
</script>
<div id="pieCanvas" style="overflow: auto; position:relative;height:350px;width:380px;"></div>
<input type="hidden" value="<? echo"$value"; ?>" name="value">
<? require_once ('../templates/mysql_connect.php');
$query = "SELECT sum(yes)as yes, sum(undecided)as undecided, sum(no)as no FROM ratings where CompanyID = 5";
$result = @mysql_query ($query);
if ($result){
while ($row =mysql_fetch_array($result, MYSQL_NUM)){
$yes = $row[0];
$undecided = $row[1];
$no = $row[2];
<script type="text/javascript">
var p = new pie();
p.add("yes",$yes);
p.add("undecided",$undecided);
p.add("no",$no);
p.render("pieCanvas", "Pie Graph")
</script>
}
mysql_free_result ($result);
}else{
echo'<p>the users could not be displayed</p><p>' . mysql_error() . '</p>';
}
mysql_close();
?>
</body>
</html>
Can any one give me some guidance on where this is going wrong?
Andy