Hi,
I got the same problem and after a lot of search i got answer in this forum but when i tried to insert i am getting errors like ACCESS VIOLATION... why whats wrong with me ?
Jan Aage Eriksen wrote:
$query_string="update IMAGE_TREE ";
$query_string.="set Name='$title', ";
$query_string.="Description='$description'";
if(is_uploaded_file($bin)){
$fp=fopen($bin, 'r');
$contents = fread ($fp, $bin_size);
$contents = str_replace("'", "''", $contents);
$contents = str_replace("\"", "'\"", $contents);
$contents = str_replace("\", "'\", $contents);
$contents = str_replace(chr(0), "'".chr(0), $contents);
$query_string.=", ";
$query_string.="bintype='$bin_type', ";
$query_string.="bin=CONVERT(varbinary, '$contents') ";
} else {
$query_string.=" ";
}
$query_string.="where ID=$edit_id ";
$query_update=odbc_exec($connection, $query_string);
And I still get the error message:
SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near 'ÿØÿà'., SQL state 37000 in SQLExecDirect
I have to use convert on $contents, as it thinks it a varchar.
Yours, Jan Aage Eriksen