( ′∀`)σ≡σ☆))Д′)レ(゚∀゚;)ヘ=З=З=Зε≡(ノ´_ゝ`)ノ
<?php
include('Connections/videoondemand.php');
require("DbSql2.inc.php");
require("NewsSql2.inc.php");
$db = new NewsSQL;
//a class to handle database operations
ini_set('max_execution_time', 30000000); //300 seconds = 5 minutes
error_reporting(1);
function downloadFile($url, $path)
{
$newfname = $path;
$file = fopen ($url, 'rb');
if ($file) {
$newf = fopen ($newfname, 'wb');
if ($newf) {
while(!feof($file)) {
fwrite($newf, fread($file, 1024 * 8), 1024 * 8);
}
}
}
if ($file) {
fclose($file);
}
if ($newf) {
fclose($newf);
}
}
global $link;
$sql = "select * from profilepicture where (slug = 'content-marketing' or alias = 'content-marketing') and catalogid=152 order by id desc limit 0,500";
$result = mysqli_query($link, $sql) or die(mysqli_error($link));
while ($row1 = mysqli_fetch_assoc($result)) {
$id = $row1['id']; $title= $row1['title'];
$slug = strtolower($title);
echo $slug = preg_replace('/[^A-Za-z0-9-]+/', '-', $slug).'-'.$id;
$sql = "update profilepicture set slug='$slug',alias='$slug' WHERE id=$id";
$query = mysqli_query($link,"$sql") or die(mysqli_error());
}