OK here is the non ADODB version
INPUT PAGE
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<head>
<title>Untitled</title>
<meta name="generator" >
</head>
<body background="marble0H.gif">
<h1><img src="hours.gif" width="434" height="33" align="right"></h1>
<?
$dberror="";
$link=mysql_connect("DBNAMEHERE","USERID","PASSWORD");
if (!$link)
die("Couldn't connect to MySQL");
mysql_select_db("graphs") or die ("Couldn't open Database");
$dberror="";
if (isset($Week) )
{
$sql = "insert into graphdata (Week_No,Hours)";
$sql .= "values ('$Week','$Hours')";
if(!mysql_query($sql,$link))
{$dberror=mysql_error();
print $dberror;
}
}
?>
<br><br><br>
<table><tr><td>
<img src="graph1.php"></td><td><form>
Week Number <INPUT type="text" name="Week" size="5"><br><br>
Hours <INPUT type="text" name="Hours" size="10"><br><br>
<INPUT type="submit" value="Update"> <INPUT type="reset" value="Clear"></td>
<td>
<table><tr><td>Week</td><td>Hours</td></tr>
<?
$select="SELECT graphdata.* FROM graphdata";
$result=mysql_query($select);
while($a_row=mysql_fetch_array($result))
{
print "<tr><td>".$a_row[Week_No]."</td><td>".$a_row[Hours]."</td></tr>";
}
?>
</td></tr>
</table>
</body>
PROCESS PAGE
<?
header("Content-type:image/gif");
$dberror="";
$link=mysql_connect("SERVER","USERID","PASSWORD");
if (!$link)
die("Couldn't connect to MySQL");
mysql_select_db("graphs") or die ("Couldn't open Database");
// Here we set the colours & variables
$image=ImageCreate(540,720);
$white=ImageColorAllocate($image,255,255,255);
$red=ImageColorAllocate($image,255,0,0);
$blue=ImageColorAllocate($image,0,0,255);
$black=ImageColorAllocate($image,0,0,0);
$x=20;
$y=700;
$a=20;
$b=700;
// here we interogate the DB
$select="SELECT graphdata.* FROM graphdata";
$result=mysql_query($select);
// This section draws the graph
while($a_row=mysql_fetch_array($result))
{
ImageLine($image,$x,$y,$x+10,700-$a_row[Hours],$blue);
$x=$x+10;
$y=700-$a_row[Hours];
ImageLine($image,$a,$b,$a+10,700-$a_row[Week_No],$red);
$a=$a+10;
$b=700-$a_row[Week_No];
}
ImageLine($image,20,700,20,0,$black); // Y axis
ImageLine($image,20,700,540,700,$black); // X axis
// This section draws the x axis division lines
$z=30;
While ($z!=540)
{
ImageLine($image,$z,700,$z,710,$black);
$z=$z+10;
}
//This section draws the Y axis division lines
$w=690;
While ($w!=0)
{
ImageLine($image,20,$w,10,$w,$black);
$w=$w-10;
}
ImageGif($image); // this draws the picture
?>