Hi all,
I'm currently running the following script on my local server:
$sSQL = "SELECT movie_id,Actors FROM movie WHERE Actors != 'NULL'";
$result = mysql_query($sSQL) or print(mysql_error());
$total = mysql_num_rows($result);
echo "<b>RESULTS:</b> $total<br><br>";
while($alldata = mysql_fetch_array($result)){
$movie_id = $alldata["movie_id"];
$actors = $alldata["Actors"];
$convert_actor = explode(', ', $actors);
for ($i = 0; $i<count($convert_actor); $i++) {
$new_convert_actor = addslashes($convert_actor[$i]);
//echo "$new_convert_actors<br>";
$qSQL = "SELECT * FROM actor WHERE actor_name = '$new_convert_actor'";
$q_result = mysql_query($qSQL) or print(mysql_error());
while($data = mysql_fetch_array($q_result)){
$actor_id = $data["actor_id"];
$actor_name = stripslashes($data["actor_name"]);
echo "$movie_id - $actor_id - ";
$uSQL = "INSERT INTO movie_actor (movie_id, actor_id) VALUES ('$movie_id','$actor_id')";
$u_result = mysql_query($uSQL) or print(mysql_error());
if ($u_result){
echo "updated<br>";
} else {
echo "not updated<br>";
}
}
}
}
The problem is that it times out after 30 seconds. This is the error i get:
Fatal error: Maximum execution time of 30 seconds exceeded in c:\phpdev\www\swiftflix\admin\converter.php on line 60
Can anyone tell me either how to modify the script so it can insert all the data or is there a way to modify the execution time to a value greater than 30?
Cheers,
micmac