here i want to transfer multiple textbox box in a mysql database using php coding...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kimmi
    New Member
    • Nov 2011
    • 1

    here i want to transfer multiple textbox box in a mysql database using php coding...

    <?php
    $connection=mys ql_connect("loc alhost","root") or die( mysql_error() );

    mysql_select_db ("studentmgmt", $connection )or die( mysql_error());

    $res=mysql_quer y("select * from studentmgmt.add where deptt='I.T'");
    $id='';
    echo"<br><br><b r><br><br>";
    echo"<table align='center' border='1'>";
    echo"<form method='post' action=''>";
    echo"<th>Name</th><th>Roll no</th><th>Attenden ce</th>";
    while($row=mysq l_fetch_array($ res))
    {
    echo"<tr><td>$r ow[name]</td><td>$row[rollno]</td><td><input type='text' name='at[]'></td></tr>";
    }
    echo"<tr><td><i nput type='submit' name='submit'></td></tr>";
    echo"</form>";
    echo"</table>";

    if($_REQUEST['submit'])
    {
    $attendence[]=$_REQUEST['at[]'];
    mysql_query("in sert into studentmgmt.att endenceit(name, rollno) select name,rollno from studentmgmt.add where deptt='I.T'")or die(mysql_error ());
    mysql_query("in sert into studentmgmt.att endenceit(atten dence) values('$attend ence[]'") or die(mysql_error ());
    $res=mysql_quer y("select * from studentmgmt.att endenceit");

    /*for($i=0;$i<=m ysql_num_rows($ res);$i++)
    //while($row=mysq l_fetch_array($ res))
    {
    $attendence[$i]=$_REQUEST['at[$row]'];
    mysql_query("up date studentmgmt.att endenceit set attendence='$at tendence[$i]'")
    or die(mysql_error ());
    }*/
    }

    ?>
  • omerbutt
    Contributor
    • Nov 2006
    • 638

    #2
    Hi ,
    please use [code] tags to wrap your code inside , and whats the problem with the above code, what errors are you facing any detail,you must provide sufficent detail while asking a question and please read the Please Read Before Posting - Forum Etiquette & Useful Stuff once before posting a question.
    regards,
    Omer Aslam

    Comment

    Working...