We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14449
    • 1 Posts
    hi all, I need your help... i just want to know how insert array into mysql? thanks~

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <title>Insert New Institution</title>
    <script type="text/javascript">
    function addRowToTable()
    {
    var tbl = document.getElementById(’tblAddress’);
    var lastRow = tbl.rows.length;
    // if there’s no header row in the table, then iteration = lastRow + 1
    var iteration = lastRow;
    // var iteration = lastRow + 1;
    var row = tbl.insertRow(lastRow);

    // cell 0
    var cell0 = row.insertCell(0);
    var el = document.createElement(’input’);
    el.type = ’text’;
    el.NAME = ’InstitutionName[]’;
    el.size = 30;
    cell0.appendChild(el);

    //cell 1
    var cell1 = row.insertCell(1);
    var el = document.createElement(’input’);
    el.type = ’text’;
    el.NAME = ’Address[]’;
    el.size = 50;
    cell1.appendChild(el);

    //cell 2
    var cell2 = row.insertCell(2);
    var el = document.createElement(’input’);
    el.type = ’text’;
    el.NAME = ’Website[]’;
    el.size = 30;
    cell2.appendChild(el);

    }
    </script>
    </head>

    <body>
    <h2>Insert New Institution</h2>




    <form action="" name="" method="post">
    <table id="tblAddress">
    <tr>
    <td class="txtBase">Institution Name</td>
    <td class="txtBase">Address</td>
    <td class="txtBase">Website</td>
    </tr>
    <tr>
    <td><input name="InstitutionName[]" type="text" size="30" maxlength="100"></td>
    <td><input name="Address[]" type="text" size="50" maxlength="1000"></td>
    <td><input name="Website[]" type="text" size="30" maxlength="100"></td>
    </tr>
    </table><input type="button" name="Add" value="Add" onClick="addRowToTable();">
    <input type="submit" name="Submit" value="Submit">
    </form>


    </body>
    </html>