I have video id more than 46,000 which will be searching with my database records (about 10,000). If exist then this id will be stored in a array . I have created a php script to do that but it is take more than 50sec and with a high pressure on my laptop running WAMP. I think there are many algorithm on searching to do such work. I want to know if there any alternative faster way to do that. My code is attached below. Thanks
$query = "SELECT video_id,title FROM `all_videos`";
$res = mysql_query($query);
ini_set('max_execution_time', 300); //300 seconds = 5 minutes
while ($row = mysql_fetch_row($res)) {
$b = array_search($row[0], $arr); // Searching video id from $arr - array..
if ($b != '' or $b === 0) // Matching..
{
echo 'Match Found!! => ' . $row[0] . ' || ' . $row[1] . '<hr>';
$del[$i] = $row[0];
$i++;
}
}