i want to download the image from one server, and want to save the binery data into mysql blob field. but its not working.
if i am displaying the $picture1 then it shows the un-readable characters. byt $picture2 is not displaying.
if i try to save it in the table, then its not saving in the table.
how can i save this into my blob field.
$picture1 = GetImageFromUrl($url);
$picture2 = addslashes(fread(fopen($picture, "r"), filesize($picture)));
print_r($picture1)
print_r($picture2)
function GetImageFromUrl($link)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST, 0);
curl_setopt($ch,CURLOPT_URL,$link);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result=curl_exec($ch);
curl_close($ch);
return $result;
}