What I have:
An array with 30 keys, some keys contain only one value, while others contain several (one key contains 28 values). So firstly I don't even know if this will work. But I have tried using other examples I've found on here only to come up null.
say like such
'name' => somemovie
cast => person1, person2, person3, person4, person5, person6
poster => poster1, poster2, poster3
year => someyear
and so on and so forth
My question is: Is it possible to put these in a mysql table and if so how? I'm using PHP 5.3.
This is the code I have, and the bottom half I used some years ago, for a simple array and it worked fine. Not so much anymore.
$imdb = new Imdb();
$movieArray = $imdb->getMovieInfo("$cat");
extract ($movieArray);
$mysqli = new mysqli("localhost", "custom_xxxx", "xxxxxxxxxx", "custom_xxxx");
if ($mysqli->connect_errno) {
echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
}
echo $mysqli->host_info . "\n";
$result = mysqli_insert_array("imdb", $movieArray);
if( $result['mysqli_error'] ) {
echo "Query Failed: " . $result['mysqli_error'];
} else {
echo "Query Succeeded! <br />";
echo "<pre>";
print_r($result);
echo "</pre>";
}
?>