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:
  #1  
Old September 10th, 2002, 09:10 PM
chinni chinni is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 58 chinni User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Strange problem while inserting the records

I'm trying to insert as many as records as possible but less than 100 into a table.

First, i get the count inorder how many to add and then depending on the count, i get so many blank form fields to enter.

Now, I noticed something really strange.

1.Only the last entered record is inserted into the table.
2.For example, when I type a name, Let us assume "WORLD", only w is inserted into the table and the rest is not.It is the same with all the form fields.whether, i'm trying to enter text or a number,only the first character is inserted.This sounds weird.

Could somebody pls tell me why is this peculiar behaviour

Here is the code:
Code:
<?
Database connection

if ($frm_save == 1){
if ($enrolment==NULL) $enrolment=0;
if ($ciphering=="") $ciphering=0;
$sql = "Insert into TBL_RBS(RBS_TFTPFILENAME, RBS_TFTPSERVERIPADDRESS, RBS_RFPI, RBS_IPADDRESS, RBS_ENROLMENT, RBS_CIPHERING, RBS_MACADDRESS, RBS_SUBNETMASK, RBS_ROUTERIP) values  ('$tftp_file[$i]','$tftp_server[$i]','$rfpi[$i]',' $ip_address[$i]','$enrolment[$i]','$ciphering[$i]' ,'$mac_address[$i]','$subnet_mask[$i]','$router_ip[$i]')";
//echo "$sql";        
$result = ibase_query($connection, $sql);
ibase_commit();
}
?>

<?
//Get the number to add:
This code works fine!!!
else
{
?>
<?
//checks for array length
for ($i = 0; $i < $rbscount; $i ++)
{
$num = $i;
if (strlen($num) == "1") $num = "0" . $num;
?>

<INPUT type="text" size="10" name="rfpi" value="<? echo $rfpi; ?>"style="padding:0;">
<INPUT type=checkbox name="enrolment" value="1"<? if ($enrolment==1)echo "checked";?>>
<INPUT type=checkbox name="ciphering" value="1" <? if ($ciphering==1)echo "checked";?>>

and rest of the fields over here..........

<?
}
?>
</table>
    
<Input type="image" src="../images/sign_save.gif" name="save_button" value="Save"></br>
<input type="hidden" name="frm_save" value="1">
<?
}
?>    
</body>
</html>


Reply With Quote
  #2  
Old September 10th, 2002, 09:27 PM
notepad notepad is offline
Codewalkers Loyal (3000 - 3499 posts)
 
Join Date: Apr 2007
Location: Central, IL USA
Posts: 3,214 notepad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Send a message via AIM to notepad
RE: Strange problem while inserting the records

i think your code is incomplete.. where are you defining $rbscount? and why are you inserting values as $blah_blah[$i] when the "$i" has no value?

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > Strange problem while inserting the records


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 2 hosted by Hostway