Hi,
I'm looking to upload an Image and store the image (not the file path) in the database.
I'm able to upload the image okay and can see it is going to the temp directory. I'm then using file_get_contents however when attempting to insert this into a SQL Server i'm getting the following error message:
"Error Number: IMSSP/-46
An error occurred translating the query string to UTF-16: No mapping for the Unicode character exists in the target multi-byte code page. .
(Bunch of text including characters such as ����/�ExifMM* � ���"
I've had a look around but cannot see to get the bottom of this error. Here is my code.
[CODEBOX]
echo '<form method="post" action="'.BASE_URL().'car/upload_service" enctype="multipart/form-data">';
echo 'CarID <input type="text" name="car_id" value="'.$car->id.'" />';
echo 'Upload File <input type="file" name="file" />';
echo '<input type="submit" value="upload" />';
echo '</form>';
[/CODEBOX]
[CODEBOX]
$this->db->query("INSERT INTO car_history ('car_id','serviced_date','data2') VALUES($car_id,'".DATE('Y.m.d')."',N'".$file."')");
[/CODEBOX]