[eluser]Razican[/eluser]
Hello, I have the following array, and would like to insert it on my db:
Code:
Array (
[0] => Star Object (
[galaxy] => 1
[luminosity] => 0.69879243417539
[id] => 1
[orbit] => 25737
[type] => G
[mass] => 0.97
[radius] => 0.98
[density] => 1451.5560039509
[temperature] => 5336 )
[1] => Star Object (
[galaxy] => 1
[luminosity] => 0.0018724825764223
[id] => 2
[orbit] => 22185
[type] => M
[mass] => 0.25
[radius] => 0.26
[density] => 20033.657929607
[temperature] => 2357 )
[2] => Star Object (
[galaxy] => 1
[luminosity] => 0.00074729502287856
[id] => 3
[orbit] => 28025
[type] => M
[mass] => 0.39
[radius] => 0.14
[density] => 200180.04809125
[temperature] => 2553 ) ) 1
The problem is that I get the following errors:
Quote:array_keys() expects parameter 1 to be array, object given
database/DB_active_rec.php
Line 1109
sort() expects parameter 1 to be array, null given
database/DB_active_rec.php
Line 1110
and some more related to the fact of using an object instead of an array
I'm using CI 2.1.0
I also get the following MySQL error:
Quote:Column count doesn't match value count at row 1
INSERT INTO `sps_stars` () VALUES (1,0.043148727212324,1,21239,'M',0.22,0.69,943.22585730765,3170), (1,0.035834892964197,2,24368,'M',0.19,0.63,1070.2179772034,3167), (1,0.16953736741583,3,28055,'K',0.51,0.84,1211.9162455667,4045)
Filename: /var/www/space_settler/libraries/Bigbang.php
Line Number: 109
I'm doing it OK? is this a bug or somethig I am doing badly?