I am developing a php script, that reads data from a MYSQL database. Using phpmyadmin i can see that all data is in database and in proper format.
The database consists of text columns and a blob column.
I have now come to read back this data. I have used the following code.
$query = @"SELECT TEXT1, TEXT2, TEXT3, IMAGE FROM EXAMPLETABLE";
Do all the sql calls
Now if i do the following command then it fills the array with the text but null in the image/blob bit
while($row = mysql_fetch_array($result))
{
$posts[] = array($row['TEXT1'], $row['TEXT2'], $row['TEXT3'], $row['IMAGE']);
}
Result via Safari
[["Gbv","TR","FG",null]]
if i do the following i get the image data.
while($row = mysql_fetch_array($result))
{
ECHO $row['IMAGE'];
}
Edit So after another look at code (been working far far to hard today) i noticed that i send the array by echo json_encode($posts);
the json_encode is messing up the blob data.
Thanks