The code below is getting a VarBinary field from MSSQL, but it only retrieves 4K of data, not the whole information in the field.
What do i need to do in order to get all the Data in my VarBinary field ?
$tsql = "select file_data,file_name from rfq_detail where file_data is not null and id_master=".$p_rfq_id;
sc_select(my_data,$tsql);
if ({my_data} == true)
{
while(!$my_data->EOF)
{
$binary_data = $my_data->fields[0];
$file_name = $Root ."/". $p_rfq_id . '_' . $my_data->fields[1];
$fh = fopen($file_name, "wb");
fwrite($fh,$binary_data);
fclose($fh);
$mail->AddAttachment($file_name);
$my_data->MoveNext();
}
$my_data->Close();
}
Thanks in advance…