Insert Function isn't working!!

Discussion in 'Web Design & Programming' started by hewstone999, Jan 27, 2009.

  1. hewstone999

    hewstone999 Geek Trainee

    Likes Received:
    0
    Trophy Points:
    0
    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."

    PHP:
     <?

    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";

    }

    ?>
     
  2. edijs

    edijs Programmer

    Likes Received:
    9
    Trophy Points:
    38
    what's that(?) - total is not declared, yet, and you simply write it... and only then you declare it:
    echo "total; \n";
    echo "var total = 0; \n";

    and the Col1 is not declared either.

    Or am i getting something wrong here?
     

Share This Page