PDA

View Full Version : Inserting records into a table


am_sarath
08-27-2002, 04:26 PM
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>

Grizzly
08-27-2002, 05:32 PM
If you want anyone to actually help you, I suggest you repost that using the [ php ] formatting built into this bulletin board system. Otherwise your post is no more readable this key-chain bible I found in a septic tank.

am_sarath
08-28-2002, 08:50 AM
No mesg