I have some code(below) that the INSERT function wont work. The error message displayed is: "Fatal error</b>: Uncaught exception 'com_exception' with message 'Error [0x8002000e] Invalid number of parameters."
Code:
<?
if ($a == 1)
{
echo "<script type='text/javascript'> \n";
echo "var temp1; \n";
echo "total; \n";
echo "var total = 0; \n";
echo "var x = 0; \n";
echo "for (counter=0;counter<3;counter++){ \n";
echo "x = x + 1; \n";
echo "var temp3 = 'colid' + x; \n";
echo "var content=document.getElementsByTagName(temp3) \n";
echo "temp1 = content[0]; \n";
echo "for(c=0;c<content.length;c++) { \n";
echo "var temp4 = 1; \n";
echo "for(d=0;d<content.length;d++){ \n";
echo "if (c == d) {} \n";
echo "else{ \n";
echo "if (content[d].innerHTML == content[c].innerHTML) { \n";
echo "total = total + 1; \n";
echo "} \n";
echo "} \n";
echo "} \n";
echo "} \n";
echo "} \n";
echo "$rS2 = $db_conn->execute(\"INSERT INTO TempData(Col1) VALUES('total')\");\n";
echo "</script>\n";
}
?>
Insert Function isn't working!!
Moderator: General Moderators
Re: Insert Function isn't working!!
if the code you've given is same code as you are writing then you've not declared "total" variable(line 2 from <script>),counter variable(in for loop).
and for function, first check the number of arguments in function definition and fn calling stmt. and if that is ok,take one variable for query and pass that variable in function calling.i think that should work.
and for function, first check the number of arguments in function definition and fn calling stmt. and if that is ok,take one variable for query and pass that variable in function calling.i think that should work.