Oke, so as the title suggest I want to insert multiple values from a nested array in one database field.
Just to be clear, the array below is going to be in one record in my database not in multiple rows.
This is what my array looks like.
array(5) {
["stars"]=>
array(5) {
[0]=>
string(10) "Chris Pine"
[1]=>
string(14) "Zachary Quinto"
[2]=>
string(11) "Zoe Saldana"
[3]=>
string(10) "Karl Urban"
[4]=>
string(10) "Simon Pegg"
}
["directors"]=>
array(1) {
[0]=>
string(11) "J.J. Abrams"
}
["writers"]=>
array(4) {
[0]=>
string(12) "Roberto Orci"
[1]=>
string(13) "Alex Kurtzman"
[2]=>
string(14) "Damon Lindelof"
[3]=>
string(16) "Gene Roddenberry"
}
["genres"]=>
array(4) {
[0]=>
string(6) "Action"
[1]=>
string(9) "Adventure"
[2]=>
string(6) "Sci-Fi"
[3]=>
string(8) "Thriller"
}
["movie_data"]=>
array(12) {
["imdb_id"]=>
string(9) "tt1408101"
["slug"]=>
string(23) "star-trek-into-darkness"
["title"]=>
string(23) "Star Trek Into Darkness"
["imdb_rating"]=>
string(3) "8.2"
["release_date"]=>
string(11) "6 June 2013"
["runtime"]=>
string(4) "132m"
["mpaa_rating"]=>
string(5) "PG-13"
["storyline"]=>
string(554) "When the crew of the Enterprise is called back home, they find an unstoppable force of terror from within their own organization has detonated the fleet and everything it stands for, leaving our world in a state of crisis. With a personal score to settle, Captain Kirk leads a manhunt to a war-zone world to capture a one man weapon of mass destruction. As our heroes are propelled into an epic chess game of life and death, love will be challenged, friendships will be torn apart, and sacrifices must be made for the only family Kirk has left: his crew."
["plot"]=>
string(202) "After the crew of the Enterprise find an unstoppable force of terror from within their own organization, Captain Kirk leads a manhunt to a war-zone world to capture a one man weapon of mass destruction."
["poster_large"]=>
bool(false)
["poster"]=>
string(97) "http://ia.media-imdb.com/images/M/MV5BMTk2NzczOTgxNF5BMl5BanBnXkFtZTcwODQ5ODczOQ@@._V1._SY500.jpg"
["trailer"]=>
string(157) "http://www.youtube.com/v/QAEkuVgt6Aw&feature=youtube_gdata_player?color2=FBE9EC&hd=1&autoplay=1&showsearch=0&version=3&modestbranding=1&fs=1&iv_load_policy=3"
}
}
I have an array called "stars" inside a general array and want all values from that "stars" array in one field in my database. Called of course, stars, for easy matching and searching.
I've looked at codeigniters batch_insert function but it doesn't do want I need it to do.
I hope that someone can atleast point me in the right direction on how to proceed.
Thank you in Advance.