can anybody tell me where im going wrong in the following code:
im trying to update an access database by an onclick event that attached to a checkbox!
<html>
<head>
</head>
<body>
<?php
$db = odbc_connect("ConnLink",""
,"");
$result = odbc_exec ($db,"SELECT * FROM tblDataTechnicalQueries");
?>
<table width="100%" class="tbl">
<tr>
<th width="13%" height="2%" valign="top" align="center">Date Raised</th>
<th width="20%" height="2%" valign="top" align="center">Actionee</t
h>
<th width="20%" height="2%" valign="top" align="center">Technical Query Number</th>
<th width="45%" height="2%" valign="top" align="center">Title</th>
<th width="8%" height="2%" valign="top" align="center">Comments Submitted</th>
<th width="8%" height="2%" valign="top" align="center">Responses Submitted</th>
<th width="8%" height="2%" valign="top" align="center">Comments Approved</th>
</tr>
<?php
$count = 1;
while ($row = odbc_fetch_array($result, $count++)) {
if ($row['CommentsSubmitted']
== '1'){
$checked1 = "CHECKED";
}else{
$checked1 = "";
};
if ($row['ResponsesSubmitted'
] == '1'){
$checked2 = "CHECKED";
}else{
$checked2 = "";
}
if ($row['CommentsApproved'] == '1'){
$checked3 = "CHECKED";
}else{
$checked3 = "";
}
?>
<tr>
<td width="13%" height="5%" valign="top" align="center"><?php echo $row['Date'];?></td>
<td width="20%" height="5%" valign="top" align="center"><?php echo $row['User'];?></td>
<td width="20%" height="5%" valign="top" align="center"><?php echo $row['TQNumber'];?></td>
<td width="45%" height="5%" valign="top" align="center"><a href="<?php echo $row['Path'];?>" target="_blank"><?php echo $row['Title'];?></a></td>
<td width="8%" height="5%" valign="top" align="center"><input type="checkbox" name="CS" value=0 onClick="upDateDB1();" <?=$checked1?>></td>
<td width="8%" height="5%" valign="top" align="center"><input type="checkbox" name="RS" value=0 onClick="upDateDB2();" <?=$checked2?>></td>
<td width="8%" height="5%" valign="top" align="center"><input type="checkbox" name="CA" value=0 onClick="upDateDB3();" <?=$checked3?>></td>
</tr>
<?php } ?>
</table>
<script language="JavaScript">
function upDateDB1() {
<?php
$cs = $_GET['CS'];
$rs = $_GET['RS'];
$ca = $_GET['CA'];
$result = odbc_exec ($db,"INSERT INTO tblDataTechnicalQueries VALUES(null,null,null,null
,null,null
,'$cs','$r
s','$ca')"
)
?>
}
function upDateDB2() {
<?php
$cs = $_GET['CS'];
$rs = $_GET['RS'];
$ca = $_GET['CA'];
$result = odbc_exec ($db,"INSERT INTO tblDataTechnicalQueries VALUES(null,null,null,null
,null,null
,'$cs','$r
s','$ca')"
);
?>
}
function upDateDB3() {
<?php
$cs = $_GET['CS'];
$rs = $_GET['RS'];
$ca = $_GET['CA'];
$result = odbc_exec ($db,"INSERT INTO tblDataTechnicalQueries VALUES(null,null,null,null
,null,null
,'$cs','$r
s','$ca')"
);
?>
}
</script>
</body>
</html>
the columns in database are
Id > autonumber
Date > text
User > text
TQ > text
Title
Path
CommentsSubmitted > Yes/No
ResponsesSubmitted > Yes/No
CommentsApproved > Yes/No
that why in sql statements i have null typed 6 times...
please alter code to solve my problem is nessessary
cheers
sean
p.s. im out of office at 5p.m.....