multiple row insert

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rajasekar
    New Member
    • Sep 2006
    • 2

    multiple row insert

    hi friends,

    this my code.. i want insert multiple record.. how can i? plz send me the solution..
    <?
    for($i=0;$i<$co unt;$i++)
    {
    $n++;
    $id=mysql_resul t($res,$i,train er);
    $participant=my sql_result($res ,$i,participant );
    $fromdate=mysql _result($res,$i ,fromdate);
    $todate=mysql_r esult($res,$i,t odate);
    ?>
    <tr > <form name="attend" action="attenda nce_view_action .php" method="post">
    <td class="font_ali gn" align="center"> <? echo $n; ?></td>
    <td class="font_ali gn"><? echo $participant; ?></td>
    <td class="font_ali gn"><? echo $trainer; ?></td>
    <td class="font_ali gn"><? echo $fromdate; ?></td>
    <td class="font_ali gn"><? echo $todate; ?></td>
    <input type="hidden" name="participa nt" value=<? echo $participant; ?>>
    <input type="hidden" name="trainer" value=<? echo $trainer; ?>>
    <input type="hidden" name="fromdate" value=<? echo $fromdate; ?>>
    <input type="hidden" name="todate" value=<? echo $todate; ?>
    <td class="font_ali gn"><input type="text" id="attend_date " name="attend_da te" maxlength="10" size="10"><a href="javascrip t:NewCal('atten d_date','ddmmyy yy',false,24)"> <img src="cal.gif" width="16" height="16" border="0" alt="Pick a date"></a></td>
    <td class="font_ali gn"><input name="attendanc e" type="checkbox" ></td>

    </tr>
    <?
    } ?>
    <tr> <td class="font_ali gn" colspan="7" align="right">< input name="submit" type="submit" value="Insert"> </td></tr>
    </form>
    <?}
    else
    {?>

    <tr>
    <td>Attendanc e Not Found</td>
    </tr>

    <? }
    ?>
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    This surely is not all your code. You did not include the MySql code to read your data and you did not include any of the form handling code that processes your submitted form and supposedly performs an insert (or is it an update?). Also: what do you already have for the insert/update?

    Please show all your code (within [code] or [php] tags!) and we can all have a look.

    Ronald :cool:

    Comment

    Working...