readfile and insert to db help

#11
[eluser]sasori[/eluser]
sir, i tried both the orig. $a[$i][0] and $a[$i][1]

then i tried to
Code:
$data = array(
                        'compcode' => $a[$i][0],
                        'pricepercent' => $a[$i][1],
                        'compname' => $a[$i][2],
                        'volume' => $a[$i][3]);

          #$this->db->insert('stocks',$data);
          echo "<pre>",print_r($data),"</pre>";

Quote:Array
(
[compcode] => ABA
[pricepercent] => 0.97 0.00%
[compname] => Abacus A
[volume] => 50,000
)
1

Array
(
[compcode] => ABS
[pricepercent] => 22.00 1.1494%
[compname] => ABS-CBN
[volume] => 60,700
)
1

Array
(
[compcode] => ABSP
[pricepercent] => 22.25 1.1364%
[compname] => ABS-CBN PDR
[volume] => 78,500
)
1

it seem to work fine..but then when i scrolled down the browser i saw these 3 stuffs
Quote:A PHP Error was encountered

Severity: Notice

Message: Undefined offset: 1

Filename: models/stock_model.php

Line Number: 29
Quote:A PHP Error was encountered

Severity: Notice

Message: Undefined offset: 2

Filename: models/stock_model.php

Line Number: 34
Quote:A PHP Error was encountered

Severity: Notice

Message: Undefined offset: 3

Filename: models/stock_model.php

Line Number: 35

i got no idea why it got 3 errors at the last part ?


Messages In This Thread
readfile and insert to db help - by El Forum - 01-19-2010, 05:16 AM
readfile and insert to db help - by El Forum - 01-19-2010, 05:19 AM
readfile and insert to db help - by El Forum - 01-19-2010, 05:19 AM
readfile and insert to db help - by El Forum - 01-19-2010, 05:21 AM
readfile and insert to db help - by El Forum - 01-19-2010, 05:23 AM
readfile and insert to db help - by El Forum - 01-19-2010, 05:28 AM
readfile and insert to db help - by El Forum - 01-19-2010, 05:35 AM
readfile and insert to db help - by El Forum - 01-19-2010, 05:37 AM
readfile and insert to db help - by El Forum - 01-19-2010, 05:40 AM
readfile and insert to db help - by El Forum - 01-19-2010, 05:42 AM
readfile and insert to db help - by El Forum - 01-19-2010, 05:48 AM
readfile and insert to db help - by El Forum - 01-19-2010, 05:51 AM
readfile and insert to db help - by El Forum - 01-19-2010, 06:22 AM
readfile and insert to db help - by El Forum - 01-19-2010, 06:52 AM
readfile and insert to db help - by El Forum - 01-19-2010, 07:02 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.