query($sql);
$temparray = $adb->fetch_array($result);
$fileContent = $temparray['data'];
$filename=$temparray['filename'];
$filesize=$temparray['filesize'];
$wordtemplatedownloadpath =$_SERVER['DOCUMENT_ROOT'] ."/test/wordtemplatedownload/";
//echo '
file name and size is ..'.$filename .'...'.$filesize;
$handle = fopen($wordtemplatedownloadpath .$temparray['filename'],"wb") ;
//chmod("/home/rajeshkannan/test/".$fileContent,0755);
fwrite($handle,base64_decode($fileContent),$filesize);
fclose($handle);
$query = "SELECT * FROM " .$_REQUEST["module"] ." where id = '".$_REQUEST['record'] ."'";
//echo $query;
$result = $adb->query($query);
$y=$adb->num_fields($result);
for ($x=0; $x<$y; $x++)
{
$columnNames[$x] = "CONTACT_".strtoupper($adb->field_name($result, $x));
}
$columnValues = $adb->fetch_array($result);
for ($x=0; $x<$y; $x++)
{
$columnValString[$x] = $columnValues[$x];
}
$columnString = implode(",",$columnNames);
$columnValString = implode(",",$columnValString);
echo"";
?>