|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Inserting records into a table
Hello,
I am trying to add some fileds into my table.Before that, when i click on "ADD " it asks me how many to add and when we mention the number, it displays as many text boxes as the number entered before. for example, when i click 3 and try to fill all the text boxes, i see only one record is entered.why is this happening? Does it mean my array is not proper?could somebody of you pls tell me where the error is: Here is my script: <? include "dbconnection.ini"; if ($frm_save == 1){ Insert statement; } ?> //Get the number of sets to be added: if ($rbscount == "" || $rbscount < 1 || $rbscount > 100) { echo ("<table> <tr> <td> </td> </tr><tr> <td><input type="text" name="rbscount"></td> </tr><tr> <td> <Input type="image" src="../images/sign_details.gif" name="save_button" value="Save"></br>"); echo (" </td> </tr> </table>"); } else { ?> All my field headings <? //checks for array length for ($i = 0; $i < $rbscount; $i ++) { $num = $i; if (strlen($num) == "1") $num = "0" . $num; ?> <tr style="margin:0; padding:0;"> <td width="78" height="23" align="left" valign="top"> <p style="line-height:100%; margin-top:0; margin-bottom:0;"><FONT face=Verdana><SPAN style="FONT-SIZE: 10pt"><INPUT type="text" size="10" name="rfpi" value="<? echo $rfpi; ?>"style="padding:0;"></SPAN></FONT></p> </td> <td width="78" height="23" align="left" valign="top"><P style="line-height:100%; margin-top:0; margin-bottom:0;"><font face="Verdana"><span style="font-size:10pt;"><input type="text" size="10" name="ip_address" value="<? echo $ipaddress; ?>"></span></font></P></td> <td width="75" height="23" align="left" valign="top"><P style="line-height:100%; margin-top:0; margin-bottom:0;"><FONT face=Verdana><SPAN style="FONT-SIZE: 10pt"> <INPUT type=checkbox name="enrolment" value="1"<? if ($enrolment==1)echo "checked";?>></SPAN></FONT></P></td> <td width="75" height="23" align="left" valign="top"><P style="line-height:100%; margin-top:0; margin-bottom:0;"><FONT face=Verdana><SPAN style="FONT-SIZE: 10pt"> <INPUT type=checkbox name="ciphering" value="1" <? if ($ciphering==1)echo "checked";?>></SPAN></FONT></P></td> <td width="85" height="23" align="left" valign="top"><P style="line-height:100%; margin-top:0; margin-bottom:0;"><FONT face=Verdana><SPAN style="FONT-SIZE: 10pt"><INPUT type="text" size="10" name="mac_address" value="<? echo $macaddress; ?>"></SPAN></FONT></P></td> <td width="78" height="23" align="left" valign="top"><P style="line-height:100%; margin-top:0; margin-bottom:0;"><font face="Verdana"><span style="font-size:10pt;"><input type="text" size="10" name="subnet_mask" value="<? echo $subnetmask; ?>"></span></font></P></td> <td width="84" height="23" align="left" valign="top"> <p style="line-height:100%; margin-top:0; margin-bottom:0;"><font face="Verdana"><span style="font-size:10pt;"><input type="text" size="10" name="router_ip" value="<? echo $routerip; ?>"></span></font></p> </td> <td width="84" height="23" align="left" valign="top"> <p style="line-height:100%; margin-top:0; margin-bottom:0;"><font face="Verdana"><span style="font-size:10pt;"><input type="text" size="10" name="tftp_server" value="<? echo $tftpserver; ?>"></span></font></p> </td> <td width="106" height="23" align="left" valign="top"> <p style="line-height:100%; margin-top:0; margin-bottom:0;"><font face="Verdana"><span style="font-size:10pt;"><input type="text" size="15" name="tftp_file" value="<? echo $tftpfile; ?>"></span></font></p> </td> </tr> <? } ?> </table> <Input type="image" src="../images/sign_save.gif" name="save_button" value="Save"></br> <input type="hidden" name="frm_save" value="1"> <? } ?> </form> </body> </html> |
|
#2
|
|||
|
|||
|
RE: Inserting records into a table
you need to make all of your formfields arrays using []
|
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > Inserting records into a table |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|