Hey guys. I’m using the IMDB api to extract IMDB information but im unsure how to pass the info to my DB.
This code works great
[php]$imdb_json=file_get_contents(“http://imdbapi.org/?title=title”);
$imdb_info=json_decode($imdb_json);
echo “”;
echo “”;
echo “”;
echo “”;
echo " " .$imdb_info[0]->title;
echo " ";
echo " " .$imdb_info[0]->runtime[0];
echo " ";
echo " " .$imdb_info[0]->rating;
echo “”;
echo " plot simple " . $imdb_info[0]->plot_simple;
echo “”;[/php]
but when I try to pass it into the database using
[php]$sql=“INSERT INTO database ( title)
VALUES
(’$imdb_info[0]->plot_simple’)”;[/php]
it breaks the code. Looks like its some type of syntax error. Hoping you could point me at the right direction.