PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
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  
Old August 27th, 2002, 09:28 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
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">&nbsp;&nbsp;&nbsp;&nbsp;<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">&nbsp;&nbsp;&nbsp;<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>





Reply With Quote
  #2  
Old August 29th, 2002, 12:26 AM
guyer guyer is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Bloomington, IN USA
Posts: 47 guyer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via Yahoo to guyer
RE: Inserting records into a table

you need to make all of your formfields arrays using []

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > Inserting records into a table


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway