Free Web Hosting Forum
(#1 (permalink))
Old
Junior Member
clueo8 is on a distinguished road
 
Posts: 2
Join Date: Nov 2008
Unhappy Very Strange PHP Code Issue - 11-17-2008, 03:22 PM

I have a php page which displays a bunch of data from a database. I had this page running fine on my previous host (php version: 4.4.1). To start off with my issue, I have 36 records which I need to update. For some odd reason, only the last 3 get lost. Here is what I should see:
Code:
i=33
id=11
wins=18
loses=37
stock=1

i=34
id=15
wins=2
loses=7
stock=-1

i=35
id=39
wins=1
loses=2
stock=1
But this is what I see:
Code:
i=33
id=11
wins=
loses=
stock=

i=34
id=15
wins=
loses=
stock=

i=35
id=39
wins=
loses=
stock=
Here is how I populate these variables from my database:
PHP Code:
<input name="wins[]" id="s_<? echo $row[member_id]; ?>" value="<? echo $row[member_wins]; ?>">
<input name="losses[]" id="s_<? echo $row[member_id]; ?>" value="<? echo $row[member_losses]; ?>">
<input name="stock[]" id="s_<? echo $row[member_id]; ?>" value="<? echo $row[member_stock]; ?>">
And then this is how I access them:
PHP Code:
for($i=0;$i<$total_count;$i++) {
        
$wins[$i] = $_POST"wins" ][ $i ];
        
$losses[$i] = $_POST"losses" ][ $i ];
        
$stock[$i] = $_POST"stock" ][ $i ];

        print 
"i=".$i;
        print 
"<br/>";
        print 
"id=".$id[$i];
        print 
"<br/>";
        print 
"wins=".$wins[$i];
        print 
"<br/>";
        print 
"loses=".$losses[$i];
        print 
"<br/>";
        print 
"stock=".$stock[$i];
        print 
"<br/>";
        print 
"<br/>";

The strange thing is, this code works 100% on another webhost but for some reason, drops the last 3 records on 000webhost.

Does anyone see something wrong?

Thanks in advance!
Reply With Quote
Sponsored Links
(#2 (permalink))
Old
Banned
YaThisHostRox is on a distinguished road
 
Posts: 371
Join Date: Jul 2008
Location: IM me plz. I need more intelligence.
Send a message via AIM to YaThisHostRox Send a message via MSN to YaThisHostRox Send a message via Yahoo to YaThisHostRox Send a message via Skype™ to YaThisHostRox
Default 11-21-2008, 12:02 AM

Switch to another host or rewrite your code.
Reply With Quote
(#3 (permalink))
Old
Junior Member
clueo8 is on a distinguished road
 
Posts: 2
Join Date: Nov 2008
Default 11-21-2008, 02:27 PM

code was rewritten, problem solved.
Reply With Quote
Reply

Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.5.2
vBulletin Skin developed by: vBStyles.com